diff --git a/code/tango_with_django_project/rango/tests.py b/code/tango_with_django_project/rango/tests.py index 222ef88..4cd8253 100644 --- a/code/tango_with_django_project/rango/tests.py +++ b/code/tango_with_django_project/rango/tests.py @@ -47,7 +47,6 @@ def test_about_contains_create_message(self): response = self.client.get(reverse('about')) self.assertIn(b'This tutorial has been put together by', response.content) - def test_about_contain_image(self): # Check if is there an image on the about page # Chapter 4 @@ -103,12 +102,12 @@ class Chapter4ViewTests(TestCase): def test_index_contains_hello_message(self): # Check if there is the message 'hello world!' response = self.client.get(reverse('index')) - self.assertIn('Rango says', response.content) + self.assertContains(response, 'Rango says') def test_does_index_contain_img(self): # Check if the index page contains an img response = self.client.get(reverse('index')) - self.assertIn('img', response.content) + self.assertContains(response, 'img') def test_about_using_template(self): # Check the template used to render index page @@ -120,12 +119,12 @@ def test_about_using_template(self): def test_does_about_contain_img(self): # Check if in the about page contains an image response = self.client.get(reverse('about')) - self.assertIn('img', response.content) + self.assertContains(response, 'img') def test_about_contains_create_message(self): # Check if in the about page contains the message from the exercise response = self.client.get(reverse('about')) - self.assertIn('This tutorial has been put together by', response.content) + self.assertContains(response, 'This tutorial has been put together by') class Chapter5ViewTests(TestCase): @@ -168,14 +167,14 @@ def test_view_has_title(self): response = self.client.get(reverse('index')) #Check title used correctly - self.assertIn('