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
ac956dae
Kaydet (Commit)
ac956dae
authored
Ock 25, 2019
tarafından
Jon Dufresne
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed grammar in FakePayload exception message.
üst
7e978fdc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
client.py
django/test/client.py
+1
-1
test_fakepayload.py
tests/test_client/test_fakepayload.py
+11
-0
No files found.
django/test/client.py
Dosyayı görüntüle @
ac956dae
...
@@ -76,7 +76,7 @@ class FakePayload:
...
@@ -76,7 +76,7 @@ class FakePayload:
def
write
(
self
,
content
):
def
write
(
self
,
content
):
if
self
.
read_started
:
if
self
.
read_started
:
raise
ValueError
(
"Unable to write a payload after
he
's been read"
)
raise
ValueError
(
"Unable to write a payload after
it
's been read"
)
content
=
force_bytes
(
content
)
content
=
force_bytes
(
content
)
self
.
__content
.
write
(
content
)
self
.
__content
.
write
(
content
)
self
.
__len
+=
len
(
content
)
self
.
__len
+=
len
(
content
)
...
...
tests/test_client/test_fakepayload.py
0 → 100644
Dosyayı görüntüle @
ac956dae
from
django.test
import
SimpleTestCase
from
django.test.client
import
FakePayload
class
FakePayloadTests
(
SimpleTestCase
):
def
test_write_after_read
(
self
):
payload
=
FakePayload
()
payload
.
read
()
msg
=
"Unable to write a payload after it's been read"
with
self
.
assertRaisesMessage
(
ValueError
,
msg
):
payload
.
write
(
b
'abc'
)
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