From 521772ff0779ced13f94a6ebcd96740a9eafbb1d Mon Sep 17 00:00:00 2001 From: Ed Henderson Date: Thu, 2 Jun 2016 12:56:13 -0700 Subject: [1.10.x] Fixed #26021 -- Applied hanging indentation to docs. Backport of 4a4d7f980e2a66756e1e424f7648dcd28ff765b7 from master --- docs/intro/tutorial05.txt | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'docs/intro/tutorial05.txt') diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt index 45fdb3746d..bfb43358e6 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 -------------------- -- cgit v1.3