diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-05-15 00:21:40 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-05-15 00:22:08 +0200 |
commit | b6603ce4607982590d7d55c0d583809192d84cad (patch) | |
tree | 8aa3c0bf481a67717987af0710540668d3467ab0 /tests/controllers/article.py | |
parent | adding base unittests (diff) | |
download | newspipe-b6603ce4607982590d7d55c0d583809192d84cad.tar.gz newspipe-b6603ce4607982590d7d55c0d583809192d84cad.tar.bz2 newspipe-b6603ce4607982590d7d55c0d583809192d84cad.zip |
testing special controller methods
Diffstat (limited to 'tests/controllers/article.py')
-rw-r--r-- | tests/controllers/article.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/controllers/article.py b/tests/controllers/article.py index b6c5225c..9a635fa7 100644 --- a/tests/controllers/article.py +++ b/tests/controllers/article.py @@ -10,3 +10,14 @@ class ArticleControllerTest(BasePyaggTest): self.assertFalse(article['readed']) article['readed'] = True # article get read when retreived through get self._test_controller_rights(article, article['user_id']) + self.assertEquals(0, len(list(ArticleController().challenge( + [{'id': art.id} for art in ArticleController(3).read()])))) + self.assertEquals(9, len(list(ArticleController(2).challenge( + [{'id': art.id} for art in ArticleController(3).read()])))) + self.assertEquals(9, len(list(ArticleController(2).challenge( + [{'entry_id': art.id} for art in ArticleController(3).read()] + )))) + self.assertEquals({1: 2, 2: 3, 3: 3}, + ArticleController(2).get_unread()) + self.assertEquals({4: 3, 5: 3, 6: 3}, + ArticleController(3).get_unread()) |