예제 #1
0
파일: test_views.py 프로젝트: XeryusTC/rotd
 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)
예제 #2
0
파일: test_views.py 프로젝트: XeryusTC/rotd
 def test_new_day_means_new_recipe(self):
     today = date.today()
     tomorrow = today + timedelta(days=1)
     self.assertNotEqual(todays_recipe(today), todays_recipe(tomorrow))
예제 #3
0
파일: test_views.py 프로젝트: XeryusTC/rotd
 def test_todays_recipe_default_is_today(self):
     self.assertEqual(todays_recipe(), todays_recipe(date.today()))
예제 #4
0
파일: test_views.py 프로젝트: XeryusTC/rotd
 def test_todays_recipe_returns_recipe_in_database(self):
     self.assertIn(todays_recipe(), Recipe.objects.all())
예제 #5
0
파일: test_views.py 프로젝트: XeryusTC/rotd
 def test_todays_recipe_returns_recipe(self):
     self.assertIsInstance(todays_recipe(), Recipe)
예제 #6
0
파일: test_views.py 프로젝트: XeryusTC/rotd
 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)