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)
def test_new_day_means_new_recipe(self): today = date.today() tomorrow = today + timedelta(days=1) self.assertNotEqual(todays_recipe(today), todays_recipe(tomorrow))
def test_todays_recipe_default_is_today(self): self.assertEqual(todays_recipe(), todays_recipe(date.today()))
def test_todays_recipe_returns_recipe_in_database(self): self.assertIn(todays_recipe(), Recipe.objects.all())
def test_todays_recipe_returns_recipe(self): self.assertIsInstance(todays_recipe(), Recipe)
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)