Example #1
0
 def test_changing_recipe_doesnt_change_todays_recipe(self):
     today = date.today()
     before = todays_recipe(today)
     before.name = 'Changed name'
     before.save()
     after = todays_recipe(today)
     self.assertEqual(before.pk, after.pk)
Example #2
0
 def test_new_day_means_new_recipe(self):
     today = date.today()
     tomorrow = today + timedelta(days=1)
     self.assertNotEqual(todays_recipe(today), todays_recipe(tomorrow))
Example #3
0
 def test_todays_recipe_default_is_today(self):
     self.assertEqual(todays_recipe(), todays_recipe(date.today()))
Example #4
0
 def test_todays_recipe_returns_recipe_in_database(self):
     self.assertIn(todays_recipe(), Recipe.objects.all())
Example #5
0
 def test_todays_recipe_returns_recipe(self):
     self.assertIsInstance(todays_recipe(), Recipe)
Example #6
0
 def test_adding_new_recipe_doesnt_change_todays_recipe(self):
     today = date.today()
     before = todays_recipe(today)
     factories.RecipeFactory(post=True)
     after = todays_recipe(today)
     self.assertEqual(before, after)