Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
484edc81
Kaydet (Commit)
484edc81
authored
Eki 23, 2015
tarafından
薛丞宏
Kaydeden (comit)
Tim Graham
Eki 23, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clarified that the test client response content attribute is bytes.
üst
89359347
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
tutorial05.txt
docs/intro/tutorial05.txt
+2
-2
request-response.txt
docs/ref/request-response.txt
+1
-1
tools.txt
docs/topics/testing/tools.txt
+3
-3
No files found.
docs/intro/tutorial05.txt
Dosyayı görüntüle @
484edc81
...
...
@@ -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 <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
...
...
@@ -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 <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']
...
...
docs/ref/request-response.txt
Dosyayı görüntüle @
484edc81
...
...
@@ -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
...
...
docs/topics/testing/tools.txt
Dosyayı görüntüle @
484edc81
...
...
@@ -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.
...
...
@@ -433,8 +433,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment