From 484edc81c1ebd195c333f3ea8d3f9ca882a17837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E4=B8=9E=E5=AE=8F?= Date: Fri, 23 Oct 2015 21:12:49 +0800 Subject: [PATCH] Clarified that the test client response content attribute is bytes. --- docs/intro/tutorial05.txt | 4 ++-- docs/ref/request-response.txt | 2 +- docs/topics/testing/tools.txt | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt index a1b594dbc2..617b4d077e 100644 --- a/docs/intro/tutorial05.txt +++ b/docs/intro/tutorial05.txt @@ -367,7 +367,7 @@ With that ready, we can ask the client to do some work for us:: >>> response.status_code 200 >>> response.content - '\n\n\n

No polls are available.

\n\n' + b'\n\n\n

No polls are available.

\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 @@ -379,7 +379,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 \n\n' + b'\n\n\n \n\n' >>> # If the following doesn't work, you probably omitted the call to >>> # setup_test_environment() described above >>> response.context['latest_question_list'] diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 2e43506a88..b29da67332 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -941,7 +941,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 diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 43255fa589..10945cc070 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -54,7 +54,7 @@ Web pages:: 200 >>> response = c.get('/customer/details/') >>> response.content - '