From fd528d031511c97e0ea400d255d99f6a11e089b9 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 12 Sep 2025 14:04:47 -0700 Subject: [PATCH] Revert "Try this?" This reverts commit d15fceab6c8ed33790b2d69ef4baf7b16bad4b23. --- .../tests/test_migration_archive_files.py | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/documents/tests/test_migration_archive_files.py b/src/documents/tests/test_migration_archive_files.py index 05a6fab05..402897e2f 100644 --- a/src/documents/tests/test_migration_archive_files.py +++ b/src/documents/tests/test_migration_archive_files.py @@ -281,34 +281,6 @@ class TestMigrateArchiveFilesErrors(DirectoriesMixin, TestMigrations): migrate_to = "1012_fix_archive_files" auto_migrate = False - def tearDown(self): - """ - These tests intentionally assert that 1012 raises during performMigration. - When the base TestMigrations tearDown later migrates back to HEAD, the - 1012 data step would raise again. Patch that RunPython op to a no-op so - we still apply the schema changes but skip the data movement during teardown. - """ - try: - import importlib - - from django.db import migrations as dj_migrations - - mig_mod = importlib.import_module( - "documents.migrations.1012_fix_archive_files", - ) - - def _noop(apps, schema_editor): - return None - - for op in getattr(mig_mod.Migration, "operations", []): - if isinstance(op, dj_migrations.RunPython): - op.code = _noop - op.reverse_code = dj_migrations.RunPython.noop - except Exception: - pass - - super().tearDown() - def test_archive_missing(self): Document = self.apps.get_model("documents", "Document")