From c2c30541bbbfe83fca43749208d29c17b364bf75 Mon Sep 17 00:00:00 2001 From: stumpylog <797416+stumpylog@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:04:01 -0700 Subject: [PATCH] Test: guard --zip combined with --compare-* flags --- .../tests/test_management_exporter.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/documents/tests/test_management_exporter.py b/src/documents/tests/test_management_exporter.py index b15dc07da..44456535a 100644 --- a/src/documents/tests/test_management_exporter.py +++ b/src/documents/tests/test_management_exporter.py @@ -1058,6 +1058,26 @@ class TestExportImport( self.assertEqual(Document.objects.all().count(), 4) + def test_zip_with_compare_flags_raises(self) -> None: + """ + GIVEN: + - A request to export to a zip file + WHEN: + - --compare-checksums or --compare-json is also passed + THEN: + - A CommandError is raised (the flags are no-ops in zip mode) + """ + for flag in ("--compare-checksums", "--compare-json"): + with self.subTest(flag=flag): + with self.assertRaises(CommandError): + call_command( + "document_exporter", + self.target, + "--zip", + flag, + skip_checks=True, + ) + @pytest.mark.management class TestCryptExportImport(