Permalink
Browse files

Added tests for putting information into a database

  • Loading branch information...
1 parent ad62abe commit fcf1e7de0264dad3836cd97bbabbd81a24969c69 @lindseydew lindseydew committed Feb 2, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 feeds/tests.py
View
@@ -12,11 +12,15 @@
class SimpleTest(TestCase):
def test_store_story(self):
- """
- Tests that 1 + 1 always equals 2.
- """
- story = Story.objects.create(title="foo", published = datetime.datetime(2012,02,02,12,12), )
+
+ story = Story.objects.create(title="foo", published = datetime.datetime(2012,02,02,12,12), description = "This is a description of a story", source = "twitter", permalink = "http://www.linktostory.com", views = 14030)
story.save()
saved = Story.objects.get(title="foo")
self.assertEqual(saved.title, "foo")
+ self.assertEqual(saved.published, datetime.datetime(2012,02,02,12,12))
+ self.assertEqual(saved.description, "This is a description of a story")
+ self.assertEqual(saved.source, "twitter")
+ self.assertEqual(saved.permalink, "http://www.linktostory.com")
+ self.assertEqual(saved.views, 14030)
+

0 comments on commit fcf1e7d

Please sign in to comment.