Permalink
Browse files

make sure we use assertTemplateUsed throughout. HP

  • Loading branch information...
1 parent 0d41038 commit 49c3a17d9866b8d0f4d366ddb44be6a449cd9b7e @hjwp committed Jul 18, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 mysite/polls/tests/test_views.py
  2. +2 −2 tutorial03.rst
View
4 mysite/polls/tests/test_views.py
@@ -15,8 +15,8 @@ def test_root_url_shows_links_to_all_polls(self):
response = self.client.get('/')
- template_names_used = [t.name for t in response.templates]
- self.assertIn('home.html', template_names_used)
+ # check we've used the right template
+ self.assertTemplateUsed(response, 'home.html')
# check we've passed the polls to the template
polls_in_context = response.context['polls']
View
4 tutorial03.rst
@@ -781,8 +781,8 @@ probably find the poll using its ``id``. Here's what that translates to in
response = self.client.get('/')
- template_names_used = [t.name for t in response.templates]
- self.assertIn('home.html', template_names_used)
+ # check we've used the right template
+ self.assertTemplateUsed(response, 'home.html')
# check we've passed the polls to the template
polls_in_context = response.context['polls']

0 comments on commit 49c3a17

Please sign in to comment.