From e85168a61691cdbf7c9d980552547b20434f3bf7 Mon Sep 17 00:00:00 2001 From: stumpylog <797416+stumpylog@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:17:04 -0700 Subject: [PATCH] Mocks this test to pass on 3.14 too --- .../tests/test_management_exporter.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/documents/tests/test_management_exporter.py b/src/documents/tests/test_management_exporter.py index 3020dc7d5..9666da5d6 100644 --- a/src/documents/tests/test_management_exporter.py +++ b/src/documents/tests/test_management_exporter.py @@ -1172,8 +1172,24 @@ class TestExportImport( - --zip-compression zstd is requested THEN: - A CommandError naming the Python version requirement is raised + + zstd availability is mocked rather than relying on the actual + runtime: on a Python 3.14+ CI leg, ZSTD is not None, so without the + mock this check is skipped and the command falls through into the + real export, which fails on missing document files instead of + raising the expected CommandError. """ - with self.assertRaises(CommandError) as e: + with ( + mock.patch( + "documents.management.commands.document_exporter.ZSTD", + None, + ), + mock.patch( + "documents.management.commands.document_exporter.compression_available", + return_value=False, + ), + self.assertRaises(CommandError) as e, + ): call_command( "document_exporter", self.target,