Skip to content

Commit 5ebf37d

Browse files
committed
Avoid throttling on tests
1 parent 329082a commit 5ebf37d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

readthedocs/api/v3/tests/test_projects.py

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from pathlib import Path
55

66

7+
from django.core.cache import cache
78
from django.contrib.auth.models import User
89
from django.test import TestCase
910
from django.urls import reverse
@@ -101,6 +102,10 @@ def setUp(self):
101102

102103
self.client = APIClient()
103104

105+
def tearDown(self):
106+
# Cleanup cache to avoid throttling on tests
107+
cache.clear()
108+
104109
def _get_response_dict(self, view_name):
105110
filename = Path(__file__).absolute().parent / 'responses' / f'{view_name}.json'
106111
return json.load(open(filename))

0 commit comments

Comments
 (0)