diff options
| author | Patrick Arminio <patrick.arminio@gmail.com> | 2020-11-02 17:42:13 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-11-03 10:12:40 +0100 |
| commit | 542b4b3ab44d33dfd9b00c22f624ee4aed6f7534 (patch) | |
| tree | 423efd16cdea32e16d176fc6dbcb1af165da9238 /django | |
| parent | b03b19b585a0a3685d48dae95d060d13ff4755fa (diff) | |
Fixed #32162 -- Fixed setting Content-Length header in AsyncRequestFactory.
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/client.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/test/client.py b/django/test/client.py index ba1c37ed59..dfd443a83c 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -540,7 +540,7 @@ class AsyncRequestFactory(RequestFactory): } if data: s['headers'].extend([ - (b'content-length', bytes(len(data))), + (b'content-length', str(len(data)).encode('ascii')), (b'content-type', content_type.encode('ascii')), ]) s['_body_file'] = FakePayload(data) |
