def test_user_adds_existing_feed(self): url = "http://example2.com" models.add_feed(url, name="URL 1") models.add_feed(url, name="URL 2") # This should not overwrite the old name feeds = models.Feed.objects.filter(feed_url=url) self.assertEqual(len(feeds), 1) self.assertEqual(feeds[0].name, "URL 1")
def test_create_feed(self): self.assertEquals(0, Feed.all().count()) add_feed('http://rss.slashdot.org/Slashdot/slashdot') self.assertEquals(1, Feed.all().count())
def test_user_adds_unnamed_feed(self): url = "http://example.com" models.add_feed(url) self.assertTrue(models.Feed.objects.filter(feed_url=url).exists())