summaryrefslogtreecommitdiff
path: root/django/test/testcases.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-13 11:30:27 +0100
committerGitHub <noreply@github.com>2023-01-13 11:30:27 +0100
commitc2118d72d61746f2462fca695dbf3adf44ebf8f7 (patch)
treed1891d1801cc59f2ea8294a8ae5857fd414f15b6 /django/test/testcases.py
parent648005dee62481acc1784e5c9625e90f0fd6aab4 (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.py2
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(