From 99bd5fb4c2d51f7bf8a19b2c12a603ab38b85ec9 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Sat, 24 Dec 2022 00:10:25 +0100 Subject: Refs #34074 -- Used headers argument for RequestFactory and Client in docs and tests. --- tests/cache/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/cache') 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)) -- cgit v1.3