diff options
| author | Carlton Gibson <carlton@noumenal.es> | 2020-11-04 11:07:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-04 11:07:15 +0100 |
| commit | ebb08d19424c314c75908bc6048ff57c2f872269 (patch) | |
| tree | 8bce4349ce1e49b86a2a1aaf3e440b7abdebf95e /django | |
| parent | c2d4926702045e342a668057f0a758eec9db9436 (diff) | |
Fixed #32159 -- Ensured AsyncRequestFactory correctly sets headers.
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/client.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/test/client.py b/django/test/client.py index dfd443a83c..2d501e0da6 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -544,7 +544,13 @@ class AsyncRequestFactory(RequestFactory): (b'content-type', content_type.encode('ascii')), ]) s['_body_file'] = FakePayload(data) - s.update(extra) + follow = extra.pop('follow', None) + if follow is not None: + s['follow'] = follow + s['headers'] += [ + (key.lower().encode('ascii'), value.encode('latin1')) + for key, value in extra.items() + ] # If QUERY_STRING is absent or empty, we want to extract it from the # URL. if not s.get('query_string'): |
