Skip to content

Commit

Permalink
test: Add test for expired file
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 19, 2024
1 parent 9250eb0 commit 4874e2c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import io
import json
import os
import shutil
from unittest.mock import patch

import libcove.lib.common as cove_common
Expand Down Expand Up @@ -261,6 +262,17 @@ def test_explore_page_null_version(client):
assert resp.status_code == 200


@pytest.mark.django_db
def test_explore_page_expired_file(client):
data = SuppliedData.objects.create()
data.original_file.save("test.json", ContentFile('{"releases":[{}]}'))
data.current_app = "cove_ocds"
shutil.rmtree(data.upload_dir())
resp = client.get(data.get_absolute_url())
assert resp.status_code == 404
assert b"automatically deleted after" in resp.content


@pytest.mark.django_db
@pytest.mark.parametrize(
"json_data",
Expand Down

0 comments on commit 4874e2c

Please sign in to comment.