Skip to content

Commit d030d67

Browse files
committed
Tear down the cache so we don’t use cache_page in tests
1 parent 2cce9dc commit d030d67

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

readthedocs/proxito/tests/test_full.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import django_dynamic_fixture as fixture
77
from django.conf import settings
8+
from django.core.cache import cache
89
from django.http import HttpResponse
910
from django.test.utils import override_settings
1011
from django.urls import reverse
@@ -232,15 +233,15 @@ def test_project_nginx_serving_unicode_filename(self):
232233
PYTHON_MEDIA=False,
233234
PUBLIC_DOMAIN='readthedocs.io',
234235
RTD_BUILD_MEDIA_STORAGE='readthedocs.rtd_tests.storage.BuildMediaFileSystemStorageTest',
235-
CACHES={
236-
'default': {
237-
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
238-
}
239-
}
240236
)
241237
class TestAdditionalDocViews(BaseDocServing):
242238
# Test that robots.txt and sitemap.xml work
243239

240+
def tearDown(self):
241+
super().tearDown()
242+
# Cleanup cache to avoid throttling on tests
243+
cache.clear()
244+
244245
@mock.patch('readthedocs.proxito.views.serve.get_storage_class')
245246
def test_default_robots_txt(self, storage_mock):
246247
storage_mock()().exists.return_value = False

0 commit comments

Comments
 (0)