>>> # get a response from '/'
>>> response = client.get('/')
>>> # we should expect a 404 from that address
>>> response.status_code
404
>>> # on the other hand we should expect to find something at '/polls/'
>>> # we'll use 'reverse()' rather than a hardcoded URL
>>> from django.core.urlresolvers import reverse
>>> response = client.get(reverse('polls:index'))
>>> response.status_code
200
>>> response.content
'\n\n\n <p>No polls are available.</p>\n\n' <-----Not getting this. See below. Seeing What's up?
>>> # note - you might get unexpected results if your ``TIME_ZONE``
>>> # in ``settings.py`` is not correct. If you need to change it,
>>> # you will also need to restart your shell session
>>> from polls.models import Question
>>> from django.utils import timezone
>>> # create a Question and save it
>>> q = Question(question_text="Who is your favorite Beatle?", pub_date=timezone.now())
>>> q.save()
>>> # check the response once again
>>> response = client.get('/polls/')
>>> response.content
'\n\n\n <ul>\n \n <li><a href="/polls/1/">Who is your favorite Beatle?</a></li>\n \n </ul>\n\n' Seeing What's up? here too.
>>> # If the following doesn't work, you probably omitted the call to
>>> # setup_test_environment() described above
>>> response.context['latest_question_list']
[<Question: Who is your favorite Beatle?>] Seeing What's up? here too
Instead of getting '\n\n\n <p>No polls are available.</p>\n\n' , the What's up poll is coming up i.e. b'r\n\t<ul>\r\n\t\r\n\t\t<li><a href="/polls/1/">What'se up?<a/></li>\r\n\t\r\n\t</ul>\r\n? The rest of the code works fine as in adding the Beatles question but the What's up? question is also coming up along with the Beatles question. Is this ok? Any help would be greatly appreciated.
Thanks,
Gavin