Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests for putting information into a database

  • Loading branch information...
commit fcf1e7de0264dad3836cd97bbabbd81a24969c69 1 parent ad62abe
@lindseydew lindseydew authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 feeds/tests.py
View
12 feeds/tests.py
@@ -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)
+
Please sign in to comment.
Something went wrong with that request. Please try again.