summaryrefslogtreecommitdiffstats
path: root/mirrors
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2018-09-08 17:37:03 +0200
committerJelle van der Waa <jelle@vdwaa.nl>2018-09-08 17:37:03 +0200
commit3cef83114803935ac29f1205a09a1a114b00c4d1 (patch)
tree717f80363254a64af642f119707d8efd3379107a /mirrors
parente4de4d3b07aa198e9589b9357a4f46ed8eb9eb66 (diff)
downloadarchweb-3cef83114803935ac29f1205a09a1a114b00c4d1.tar.gz
archweb-3cef83114803935ac29f1205a09a1a114b00c4d1.zip
Fix caching issue in test
Diffstat (limited to 'mirrors')
-rw-r--r--mirrors/tests/test_mirrorstatus.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/mirrors/tests/test_mirrorstatus.py b/mirrors/tests/test_mirrorstatus.py
index b2d4d65f..503ad280 100644
--- a/mirrors/tests/test_mirrorstatus.py
+++ b/mirrors/tests/test_mirrorstatus.py
@@ -9,23 +9,18 @@ class MirrorStatusTest(TestCase):
self.assertEqual(response.status_code, 200)
def test_json_endpoint(self):
- response = self.client.get('/mirrors/status/json/')
- self.assertEqual(response.status_code, 200)
- data = response.json()
- self.assertEqual(data['urls'], [])
-
- mirror_url = create_mirror_url()
-
- # Verify that the cache works
- response = self.client.get('/mirrors/status/json/')
- self.assertEqual(response.status_code, 200)
- data = response.json()
-
# Disables the cache_function's cache
with self.settings(CACHES={'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}}):
response = self.client.get('/mirrors/status/json/')
self.assertEqual(response.status_code, 200)
data = response.json()
+ self.assertEqual(data['urls'], [])
+
+ mirror_url = create_mirror_url()
+
+ response = self.client.get('/mirrors/status/json/')
+ self.assertEqual(response.status_code, 200)
+ data = response.json()
self.assertEqual(len(data['urls']), 1)
mirror = data['urls'][0]