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
324c4b63
Kaydet (Commit)
324c4b63
authored
Mar 07, 2017
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Renamed a test variable to prevent possible conflict with imports
üst
784a53be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
tests.py
tests/test_client_regress/tests.py
+12
-12
No files found.
tests/test_client_regress/tests.py
Dosyayı görüntüle @
324c4b63
...
...
@@ -1268,30 +1268,30 @@ class UnicodePayloadTests(SimpleTestCase):
def
test_simple_unicode_payload
(
self
):
"A simple ASCII-only JSON document can be POSTed"
# Regression test for #10571
json
=
'{"english": "mountain pass"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
,
content_type
=
"application/json"
)
self
.
assertEqual
(
response
.
content
,
json
.
encode
())
json
_str
=
'{"english": "mountain pass"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
_str
,
content_type
=
"application/json"
)
self
.
assertEqual
(
response
.
content
,
json
_str
.
encode
())
def
test_unicode_payload_utf8
(
self
):
"A non-ASCII unicode data encoded as UTF-8 can be POSTed"
# Regression test for #10571
json
=
'{"dog": "собака"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
,
content_type
=
"application/json; charset=utf-8"
)
self
.
assertEqual
(
response
.
content
,
json
.
encode
())
json
_str
=
'{"dog": "собака"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
_str
,
content_type
=
"application/json; charset=utf-8"
)
self
.
assertEqual
(
response
.
content
,
json
_str
.
encode
())
def
test_unicode_payload_utf16
(
self
):
"A non-ASCII unicode data encoded as UTF-16 can be POSTed"
# Regression test for #10571
json
=
'{"dog": "собака"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
,
content_type
=
"application/json; charset=utf-16"
)
self
.
assertEqual
(
response
.
content
,
json
.
encode
(
'utf-16'
))
json
_str
=
'{"dog": "собака"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
_str
,
content_type
=
"application/json; charset=utf-16"
)
self
.
assertEqual
(
response
.
content
,
json
_str
.
encode
(
'utf-16'
))
def
test_unicode_payload_non_utf
(
self
):
"A non-ASCII unicode data as a non-UTF based encoding can be POSTed"
# Regression test for #10571
json
=
'{"dog": "собака"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
,
content_type
=
"application/json; charset=koi8-r"
)
self
.
assertEqual
(
response
.
content
,
json
.
encode
(
'koi8-r'
))
json
_str
=
'{"dog": "собака"}'
response
=
self
.
client
.
post
(
"/parse_unicode_json/"
,
json
_str
,
content_type
=
"application/json; charset=koi8-r"
)
self
.
assertEqual
(
response
.
content
,
json
_str
.
encode
(
'koi8-r'
))
class
DummyFile
:
...
...
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