diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-12-17 13:05:26 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-12-17 13:05:26 +0100 |
commit | 0312e25586d381cc53935c2fd4912378cd292d6e (patch) | |
tree | b04ad1a26edd4c67701d0d704c8ce8c554b2ae42 /src/tests/controllers/feed.py | |
parent | Updated link to Heroku deploy button on the About page. (diff) | |
parent | handling failing feed link (diff) | |
download | newspipe-0312e25586d381cc53935c2fd4912378cd292d6e.tar.gz newspipe-0312e25586d381cc53935c2fd4912378cd292d6e.tar.bz2 newspipe-0312e25586d381cc53935c2fd4912378cd292d6e.zip |
Merge pull request #24 from jaesivsm/master
moving the root of source code from / to /src/
Diffstat (limited to 'src/tests/controllers/feed.py')
-rw-r--r-- | src/tests/controllers/feed.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tests/controllers/feed.py b/src/tests/controllers/feed.py new file mode 100644 index 00000000..6467a5a1 --- /dev/null +++ b/src/tests/controllers/feed.py @@ -0,0 +1,31 @@ +from tests.base import BasePyaggTest +from web.controllers import FeedController +from web.controllers import ArticleController + + +class FeedControllerTest(BasePyaggTest): + _contr_cls = FeedController + + def test_feed_rights(self): + feed = FeedController(2).read()[0].dump() + self.assertTrue(3, + ArticleController().read(feed_id=feed['id']).count()) + self._test_controller_rights(feed, feed['user_id']) + # checking articles are deleted after the feed has been deleted + + def test_feed_article_deletion(self): + feed_ctr = FeedController(2) + feed = feed_ctr.read()[0].dump() + feed_ctr.delete(feed['id']) + self.assertFalse(0, + ArticleController().read(feed_id=feed['id']).count()) + + def test_feed_list_fetchable(self): + self.assertEquals(3, len(FeedController(3).list_fetchable())) + self.assertEquals(0, len(FeedController(3).list_fetchable())) + self.assertEquals(3, len(FeedController().list_fetchable())) + self.assertEquals(0, len(FeedController().list_fetchable())) + self.assertEquals(3, + len(FeedController(3).list_fetchable(refresh_rate=0))) + self.assertEquals(5, + len(FeedController().list_fetchable(refresh_rate=0))) |