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:
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()