diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-13 11:30:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-13 11:30:27 +0100 |
| commit | c2118d72d61746f2462fca695dbf3adf44ebf8f7 (patch) | |
| tree | d1891d1801cc59f2ea8294a8ae5857fd414f15b6 /django/test/testcases.py | |
| parent | 648005dee62481acc1784e5c9625e90f0fd6aab4 (diff) | |
Fixed #34240 -- Preserved headers of requests made with django.test.Client in assertRedirects().
Bug in 67da22f08e05018ea968fcacbac9ac37ea925d85.
Diffstat (limited to 'django/test/testcases.py')
| -rw-r--r-- | django/test/testcases.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index 090a31e7c4..c29a13a710 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -545,10 +545,12 @@ class SimpleTestCase(unittest.TestCase): # Get the redirection page, using the same client that was used # to obtain the original response. extra = response.client.extra or {} + headers = response.client.headers or {} redirect_response = response.client.get( path, QueryDict(query), secure=(scheme == "https"), + headers=headers, **extra, ) self.assertEqual( |
