mirror of
https://github.com/django/django.git
synced 2025-12-04 00:55:36 +00:00
Isolated some cache tests; refs #23947.
This reverts a change made in 40c60efecc
which was incorrect and caused CacheKeyWarnings.
This commit is contained in:
parent
543df07720
commit
5c43fd4825
1 changed files with 4 additions and 1 deletions
5
tests/cache/tests.py
vendored
5
tests/cache/tests.py
vendored
|
|
@ -1350,6 +1350,9 @@ class CacheUtils(TestCase):
|
||||||
self.path = '/cache/test/'
|
self.path = '/cache/test/'
|
||||||
self.factory = RequestFactory(HTTP_HOST=self.host)
|
self.factory = RequestFactory(HTTP_HOST=self.host)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
cache.clear()
|
||||||
|
|
||||||
def _get_request_cache(self, method='GET', query_string=None, update_cache=None):
|
def _get_request_cache(self, method='GET', query_string=None, update_cache=None):
|
||||||
request = self._get_request(self.host, self.path,
|
request = self._get_request(self.host, self.path,
|
||||||
method, query_string=query_string)
|
method, query_string=query_string)
|
||||||
|
|
@ -1385,7 +1388,7 @@ class CacheUtils(TestCase):
|
||||||
request = self.factory.get(self.path)
|
request = self.factory.get(self.path)
|
||||||
response = HttpResponse()
|
response = HttpResponse()
|
||||||
# Expect None if no headers have been set yet.
|
# Expect None if no headers have been set yet.
|
||||||
self.assertIsNone(get_cache_key(request, response))
|
self.assertIsNone(get_cache_key(request))
|
||||||
# Set headers to an empty list.
|
# Set headers to an empty list.
|
||||||
learn_cache_key(request, response)
|
learn_cache_key(request, response)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue