Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make sure we use assertTemplateUsed throughout. HP

  • Loading branch information...
commit 49c3a17d9866b8d0f4d366ddb44be6a449cd9b7e 1 parent 0d41038
Harry Percival authored

Showing 2 changed files with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 2 mysite/polls/tests/test_views.py
  2. +2 2 tutorial03.rst
4 mysite/polls/tests/test_views.py
@@ -15,8 +15,8 @@ def test_root_url_shows_links_to_all_polls(self):
15 15
16 16 response = self.client.get('/')
17 17
18   - template_names_used = [t.name for t in response.templates]
19   - self.assertIn('home.html', template_names_used)
  18 + # check we've used the right template
  19 + self.assertTemplateUsed(response, 'home.html')
20 20
21 21 # check we've passed the polls to the template
22 22 polls_in_context = response.context['polls']
4 tutorial03.rst
Source Rendered
@@ -781,8 +781,8 @@ probably find the poll using its ``id``. Here's what that translates to in
781 781
782 782 response = self.client.get('/')
783 783
784   - template_names_used = [t.name for t in response.templates]
785   - self.assertIn('home.html', template_names_used)
  784 + # check we've used the right template
  785 + self.assertTemplateUsed(response, 'home.html')
786 786
787 787 # check we've passed the polls to the template
788 788 polls_in_context = response.context['polls']

0 comments on commit 49c3a17

Please sign in to comment.
Something went wrong with that request. Please try again.