summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorDavid Wobrock <david.wobrock@gmail.com>2022-12-24 00:10:25 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-04 09:11:36 +0100
commit99bd5fb4c2d51f7bf8a19b2c12a603ab38b85ec9 (patch)
tree72023829a9296a0ae457523fe6f223525be6a576 /tests/cache
parent0d3ccf7512edd48ac2461b7140977c16ee479d3e (diff)
downloaddjango-99bd5fb4c2d51f7bf8a19b2c12a603ab38b85ec9.tar.gz
Refs #34074 -- Used headers argument for RequestFactory and Client in docs and tests.
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index e280d3780b..a01dba46d0 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -2004,7 +2004,7 @@ class CacheUtils(SimpleTestCase):
host = "www.example.com"
path = "/cache/test/"
- factory = RequestFactory(HTTP_HOST=host)
+ factory = RequestFactory(headers={"host": host})
def tearDown(self):
cache.clear()
@@ -2095,9 +2095,9 @@ class CacheUtils(SimpleTestCase):
"""
get_cache_key keys differ by fully-qualified URL instead of path
"""
- request1 = self.factory.get(self.path, HTTP_HOST="sub-1.example.com")
+ request1 = self.factory.get(self.path, headers={"host": "sub-1.example.com"})
learn_cache_key(request1, HttpResponse())
- request2 = self.factory.get(self.path, HTTP_HOST="sub-2.example.com")
+ request2 = self.factory.get(self.path, headers={"host": "sub-2.example.com"})
learn_cache_key(request2, HttpResponse())
self.assertNotEqual(get_cache_key(request1), get_cache_key(request2))