Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/units/model/post.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2014-05-12 15:12:24 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2014-05-12 15:50:02 (GMT)
commite0008f8b1cd2ccb1e044dfbabfa30c54d07d71fa (patch)
tree4208645b16b277cb55872ea85a5aa7ec479d1291 /tests/units/model/post.py
parentfbfc90eae2909a640dfee17715f39234522ea3bf (diff)
Revert node statistics
Diffstat (limited to 'tests/units/model/post.py')
-rwxr-xr-xtests/units/model/post.py109
1 files changed, 0 insertions, 109 deletions
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()