summaryrefslogtreecommitdiff
path: root/docs/intro
diff options
context:
space:
mode:
authorEd Henderson <ed@sharpertool.com>2016-06-02 12:56:13 -0700
committerTim Graham <timograham@gmail.com>2016-06-03 11:49:52 -0400
commit6d0c9f95da7084abf09170ca5a06bd47fd20f0c4 (patch)
tree1775055fec0d52fd2c8b701f4c2f8ad8983b370f /docs/intro
parenta0ebfa0c56e16f8305d48dfa16666eb74e1350db (diff)
[1.9.x] Fixed #26021 -- Applied hanging indentation to docs.
Backport of 4a4d7f980e2a66756e1e424f7648dcd28ff765b7 from master
Diffstat (limited to 'docs/intro')
-rw-r--r--docs/intro/tutorial05.txt24
1 files changed, 9 insertions, 15 deletions
diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt
index 3bda0608a4..2925d6d23c 100644
--- a/docs/intro/tutorial05.txt
+++ b/docs/intro/tutorial05.txt
@@ -462,8 +462,7 @@ class:
in the past, positive for questions that have yet to be published).
"""
time = timezone.now() + datetime.timedelta(days=days)
- return Question.objects.create(question_text=question_text,
- pub_date=time)
+ return Question.objects.create(question_text=question_text, pub_date=time)
class QuestionViewTests(TestCase):
@@ -495,8 +494,7 @@ class:
"""
create_question(question_text="Future question.", days=30)
response = self.client.get(reverse('polls:index'))
- self.assertContains(response, "No polls are available.",
- status_code=200)
+ self.assertContains(response, "No polls are available.")
self.assertQuerysetEqual(response.context['latest_question_list'], [])
def test_index_view_with_future_question_and_past_question(self):
@@ -580,10 +578,9 @@ in the future is not:
The detail view of a question with a pub_date in the future should
return a 404 not found.
"""
- future_question = create_question(question_text='Future question.',
- days=5)
- response = self.client.get(reverse('polls:detail',
- args=(future_question.id,)))
+ future_question = create_question(question_text='Future question.', days=5)
+ url = reverse('polls:detail', args=(future_question.id,))
+ response = self.client.get(url)
self.assertEqual(response.status_code, 404)
def test_detail_view_with_a_past_question(self):
@@ -591,13 +588,10 @@ in the future is not:
The detail view of a question with a pub_date in the past should
display the question's text.
"""
- past_question = create_question(question_text='Past Question.',
- days=-5)
- response = self.client.get(reverse('polls:detail',
- args=(past_question.id,)))
- self.assertContains(response, past_question.question_text,
- status_code=200)
-
+ past_question = create_question(question_text='Past Question.', days=-5)
+ url = reverse('polls:detail', args=(past_question.id,))
+ response = self.client.get(url)
+ self.assertContains(response, past_question.question_text)
Ideas for more tests
--------------------