diff --git a/tests/search/search_export_tests.py b/tests/search/search_export_tests.py index 58fba9c5e3..518173047f 100644 --- a/tests/search/search_export_tests.py +++ b/tests/search/search_export_tests.py @@ -15,6 +15,7 @@ from django.contrib.auth.models import User from django.test.client import RequestFactory from django.urls import reverse +from django.urls.base import get_script_prefix, set_script_prefix from arches.app.views.api import SearchExport from tests.base_test import ArchesTestCase @@ -227,6 +228,16 @@ def test_login_via_basic_auth_invalid(self): self.assertEqual(request.user.username, "anonymous") self.assertEqual(response.status_code, HTTPStatus.UNAUTHORIZED) + def test_script_prefix(self): + prefix = get_script_prefix() + set_script_prefix("/nginx") + self.addCleanup(set_script_prefix, prefix) + + request = self.factory.get("/search?tiles=True&export=True&format=tilecsv") + request.user = self.user + exporter = SearchResultsExporter(search_request=request) + exporter.export(format="tilecsv", report_link="false") + def is_valid_uuid(value, version=4): """Check if value is a valid UUID."""