Skip to content

Commit

Permalink
Avoid throttling on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed May 1, 2019
1 parent 329082a commit 5ebf37d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions readthedocs/api/v3/tests/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pathlib import Path


from django.core.cache import cache
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import reverse
Expand Down Expand Up @@ -101,6 +102,10 @@ def setUp(self):

self.client = APIClient()

def tearDown(self):
# Cleanup cache to avoid throttling on tests
cache.clear()

def _get_response_dict(self, view_name):
filename = Path(__file__).absolute().parent / 'responses' / f'{view_name}.json'
return json.load(open(filename))
Expand Down

0 comments on commit 5ebf37d

Please sign in to comment.