Loading docs/intro/tutorial05.txt +2 −2 Original line number Diff line number Diff line Loading @@ -369,7 +369,7 @@ With that ready, we can ask the client to do some work for us:: >>> response.status_code 200 >>> response.content '\n\n\n <p>No polls are available.</p>\n\n' b'\n\n\n <p>No polls are available.</p>\n\n' >>> # 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 Loading @@ -381,7 +381,7 @@ With that ready, we can ask the client to do some work for us:: >>> # 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' b'\n\n\n <ul>\n \n <li><a href="/polls/1/">Who is your favorite Beatle?</a></li>\n \n </ul>\n\n' >>> # If the following doesn't work, you probably omitted the call to >>> # setup_test_environment() described above >>> response.context['latest_question_list'] Loading docs/ref/request-response.txt +1 −1 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ Typical usage could look like:: >>> from django.http import JsonResponse >>> response = JsonResponse({'foo': 'bar'}) >>> response.content '{"foo": "bar"}' b'{"foo": "bar"}' Serializing non-dictionary objects Loading docs/topics/testing/tools.txt +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ Web pages:: 200 >>> response = c.get('/customer/details/') >>> response.content '<!DOCTYPE html...' b'<!DOCTYPE html...' As this example suggests, you can instantiate ``Client`` from within a session of the Python interactive interpreter. Loading Loading @@ -417,8 +417,8 @@ Specifically, a ``Response`` object has the following attributes: .. attribute:: content The body of the response, as a string. This is the final page content as rendered by the view, or any error message. The body of the response, as a bytestring. This is the final page content as rendered by the view, or any error message. .. attribute:: context Loading Loading
docs/intro/tutorial05.txt +2 −2 Original line number Diff line number Diff line Loading @@ -369,7 +369,7 @@ With that ready, we can ask the client to do some work for us:: >>> response.status_code 200 >>> response.content '\n\n\n <p>No polls are available.</p>\n\n' b'\n\n\n <p>No polls are available.</p>\n\n' >>> # 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 Loading @@ -381,7 +381,7 @@ With that ready, we can ask the client to do some work for us:: >>> # 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' b'\n\n\n <ul>\n \n <li><a href="/polls/1/">Who is your favorite Beatle?</a></li>\n \n </ul>\n\n' >>> # If the following doesn't work, you probably omitted the call to >>> # setup_test_environment() described above >>> response.context['latest_question_list'] Loading
docs/ref/request-response.txt +1 −1 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ Typical usage could look like:: >>> from django.http import JsonResponse >>> response = JsonResponse({'foo': 'bar'}) >>> response.content '{"foo": "bar"}' b'{"foo": "bar"}' Serializing non-dictionary objects Loading
docs/topics/testing/tools.txt +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ Web pages:: 200 >>> response = c.get('/customer/details/') >>> response.content '<!DOCTYPE html...' b'<!DOCTYPE html...' As this example suggests, you can instantiate ``Client`` from within a session of the Python interactive interpreter. Loading Loading @@ -417,8 +417,8 @@ Specifically, a ``Response`` object has the following attributes: .. attribute:: content The body of the response, as a string. This is the final page content as rendered by the view, or any error message. The body of the response, as a bytestring. This is the final page content as rendered by the view, or any error message. .. attribute:: context Loading