summaryrefslogtreecommitdiff
path: root/docs/intro/tutorial05.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/intro/tutorial05.txt')
-rw-r--r--docs/intro/tutorial05.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt
index 046abb8124..1ff868b1cb 100644
--- a/docs/intro/tutorial05.txt
+++ b/docs/intro/tutorial05.txt
@@ -498,11 +498,11 @@ class:
Questions with a pub_date in the past are displayed on the
index page.
"""
- create_question(question_text="Past question.", days=-30)
+ question = create_question(question_text="Past question.", days=-30)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
- ['<Question: Past question.>']
+ [question],
)
def test_future_question(self):
@@ -520,24 +520,24 @@ class:
Even if both past and future questions exist, only past questions
are displayed.
"""
- create_question(question_text="Past question.", days=-30)
+ question = create_question(question_text="Past question.", days=-30)
create_question(question_text="Future question.", days=30)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
- ['<Question: Past question.>']
+ [question],
)
def test_two_past_questions(self):
"""
The questions index page may display multiple questions.
"""
- create_question(question_text="Past question 1.", days=-30)
- create_question(question_text="Past question 2.", days=-5)
+ question1 = create_question(question_text="Past question 1.", days=-30)
+ question2 = create_question(question_text="Past question 2.", days=-5)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
- ['<Question: Past question 2.>', '<Question: Past question 1.>']
+ [question2, question1],
)