Пример #1
0
 def testWritesEntry(self):
     routes.write_entry("tag")
     entry = Entry.objects.get(pk=1)
     self.assertEqual(entry.name, "tag")
Пример #2
0
 def testAddsStringRatingToComment(self):
     routes.write_entry("tag", 'I', 'am', 'YESOCH')
     entry = Entry.objects.get(pk=1)
     self.assertEqual(entry.comment, 'I am YESOCH')
Пример #3
0
 def testOnlyWritesIntegerRatings(self):
     routes.write_entry("tag", 'three')
     entry = Entry.objects.get(pk=1)
     self.assertEqual(entry.rating, None)
Пример #4
0
 def testOnlyWritesCommentIfCommentExists(self):
     routes.write_entry("tag")
     entry = Entry.objects.get(pk=1)
     self.assertEqual(entry.comment, None)
Пример #5
0
 def testWritesEntryComment(self):
     routes.write_entry("tag", '3', 'I', 'am', 'YESOCH')
     entry = Entry.objects.get(pk=1)
     self.assertEqual(entry.comment, 'I am YESOCH')
Пример #6
0
 def testWritesEntryRating(self):
     routes.write_entry("tag", '3')
     entry = Entry.objects.get(pk=1)
     self.assertEqual(entry.rating, 3)