From e0008f8b1cd2ccb1e044dfbabfa30c54d07d71fa Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Mon, 12 May 2014 15:12:24 +0000 Subject: Revert node statistics --- (limited to 'tests/units/model/post.py') diff --git a/tests/units/model/post.py b/tests/units/model/post.py index 655c08e..5e089ce 100755 --- a/tests/units/model/post.py +++ b/tests/units/model/post.py @@ -44,115 +44,6 @@ class PostTest(tests.Test): ['1', '3', '4'], [i.guid for i in directory.find(query='comments:foo')[0]]) - def test_ShiftContextRating(self): - volume = db.Volume('db', [Context, Post]) - this.volume = volume - - context = volume['context'].create({ - 'type': 'activity', - 'title': {}, - 'summary': {}, - 'description': {}, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - - volume['post'].create({ - 'context': context, - 'type': 'post', - 'title': {}, - 'message': {}, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - - volume['post'].create({ - 'context': context, - 'type': 'post', - 'title': {}, - 'message': {}, - 'vote': 0, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - - volume['post'].create({ - 'context': context, - 'type': 'post', - 'title': {}, - 'message': {}, - 'vote': 1, - }) - self.assertEqual([1, 1], volume['context'][context]['rating']) - - volume['post'].create({ - 'context': context, - 'type': 'post', - 'title': {}, - 'message': {}, - 'vote': 2, - }) - self.assertEqual([2, 3], volume['context'][context]['rating']) - - def test_ShiftTopicRating(self): - volume = db.Volume('db2', [Context, Post]) - this.volume = volume - - context = volume['context'].create({ - 'type': 'activity', - 'title': {}, - 'summary': {}, - 'description': {}, - }) - topic = volume['post'].create({ - 'context': context, - 'type': 'post', - 'title': {}, - 'message': {}, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - self.assertEqual([0, 0], volume['post'][topic]['rating']) - - volume['post'].create({ - 'context': context, - 'topic': topic, - 'type': 'post', - 'title': {}, - 'message': {}, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - self.assertEqual([0, 0], volume['post'][topic]['rating']) - - volume['post'].create({ - 'context': context, - 'topic': topic, - 'type': 'post', - 'title': {}, - 'message': {}, - 'vote': 0, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - self.assertEqual([0, 0], volume['post'][topic]['rating']) - - volume['post'].create({ - 'context': context, - 'topic': topic, - 'type': 'post', - 'title': {}, - 'message': {}, - 'vote': 1, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - self.assertEqual([1, 1], volume['post'][topic]['rating']) - - volume['post'].create({ - 'context': context, - 'topic': topic, - 'type': 'post', - 'title': {}, - 'message': {}, - 'vote': 2, - }) - self.assertEqual([0, 0], volume['context'][context]['rating']) - self.assertEqual([2, 3], volume['post'][topic]['rating']) - if __name__ == '__main__': tests.main() -- cgit v0.9.1