aboutsummaryrefslogtreecommitdiff
path: root/license_protected_downloads/tests/test_views.py
diff options
context:
space:
mode:
Diffstat (limited to 'license_protected_downloads/tests/test_views.py')
-rw-r--r--license_protected_downloads/tests/test_views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/license_protected_downloads/tests/test_views.py b/license_protected_downloads/tests/test_views.py
index 38c8d67..c84d652 100644
--- a/license_protected_downloads/tests/test_views.py
+++ b/license_protected_downloads/tests/test_views.py
@@ -18,6 +18,7 @@ from django.http import HttpResponse
from license_protected_downloads.buildinfo import BuildInfo
from license_protected_downloads.config import INTERNAL_HOSTS
+from license_protected_downloads.models import APIKeyStore
from license_protected_downloads.tests.helpers import temporary_directory
from license_protected_downloads.tests.helpers import TestHttpServer
from license_protected_downloads.views import _insert_license_into_db
@@ -887,6 +888,7 @@ class ViewTests(BaseServeViewTest):
# Don't care what the key is, as long as it isn't blank
self.assertRegexpMatches(response.content, "\S+")
key = response.content
+ last_used = APIKeyStore.objects.get(key=key).last_used
# Now write a file so we can upload it
file_content = "test_get_key_post_and_get_file"
@@ -918,6 +920,8 @@ class ViewTests(BaseServeViewTest):
response = self.client.get("http://testserver/file_name")
self.assertNotEqual(response.status_code, 200)
+ self.assertNotEqual(
+ APIKeyStore.objects.get(key=key).last_used, last_used)
finally:
# Delete the files generated by the test
shutil.rmtree(os.path.join(settings.UPLOAD_PATH, key))