#19681: documentation bug: tutorial 5
--------------------------------------+--------------------
     Reporter:  upadhyay@…            |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Documentation         |    Version:  master
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  1                     |      UI/UX:  0
--------------------------------------+--------------------
 Under Testing our new view:
 https://docs.djangoproject.com/en/dev/intro/tutorial05/#testing-our-new-
 view, class PollViewTests, method test_index_view_with_a_past_poll is
 wrong. It is currently:

 {{{#!python
     def test_index_view_with_a_past_poll(self):
         """
         Polls with a pub_date in the past should be displayed on the index
 page.
         """
         create_poll(question="Past poll.", days=-30)
         response = self.client.get(reverse('polls:index'))
         self.assertQuerysetEqual(
             response.context['latest_poll_list'],
             ['<Poll: Past poll.>']
         )
 }}}

 This is wrong, correct version:

 {{{#!python
     def test_index_view_with_a_past_poll(self):
         """
         Polls with a pub_date in the past should be displayed on the index
 page.
         """
         past_poll = create_poll(question="Past poll.", days=-30)
         response = self.client.get(reverse('polls:index'))
         self.assertQuerysetEqual(
             response.context['latest_poll_list'],
             [past_poll]
         )
 }}}

 There are a few other instances of this mistake in the subsequent tests.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19681>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to