File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
import io
2
2
import json
3
3
import os
4
+ import shutil
4
5
from unittest .mock import patch
5
6
6
7
import libcove .lib .common as cove_common
@@ -261,6 +262,17 @@ def test_explore_page_null_version(client):
261
262
assert resp .status_code == 200
262
263
263
264
265
+ @pytest .mark .django_db
266
+ def test_explore_page_expired_file (client ):
267
+ data = SuppliedData .objects .create ()
268
+ data .original_file .save ("test.json" , ContentFile ('{"releases":[{}]}' ))
269
+ data .current_app = "cove_ocds"
270
+ shutil .rmtree (data .upload_dir ())
271
+ resp = client .get (data .get_absolute_url ())
272
+ assert resp .status_code == 404
273
+ assert b"automatically deleted after" in resp .content
274
+
275
+
264
276
@pytest .mark .django_db
265
277
@pytest .mark .parametrize (
266
278
"json_data" ,
You can’t perform that action at this time.
0 commit comments