See if this fixes migration tests

This commit is contained in:
shamoon 2025-04-08 19:14:29 -07:00
parent 8891d5ca16
commit 571f3b4ab2
No known key found for this signature in database
14 changed files with 25 additions and 3 deletions

View File

@ -24,7 +24,6 @@ from guardian.models import GroupObjectPermission
from guardian.models import UserObjectPermission from guardian.models import UserObjectPermission
from guardian.shortcuts import assign_perm from guardian.shortcuts import assign_perm
from documents.settings import EXPORTER_FILE_NAME
from paperless.management.commands import document_exporter from paperless.management.commands import document_exporter
from paperless.models import Correspondent from paperless.models import Correspondent
from paperless.models import CustomField from paperless.models import CustomField
@ -39,6 +38,7 @@ from paperless.models import Workflow
from paperless.models import WorkflowAction from paperless.models import WorkflowAction
from paperless.models import WorkflowTrigger from paperless.models import WorkflowTrigger
from paperless.sanity_checker import check_sanity from paperless.sanity_checker import check_sanity
from paperless.settings import EXPORTER_FILE_NAME
from paperless.tests.utils import DirectoriesMixin from paperless.tests.utils import DirectoriesMixin
from paperless.tests.utils import FileSystemAssertsMixin from paperless.tests.utils import FileSystemAssertsMixin
from paperless.tests.utils import SampleDirMixin from paperless.tests.utils import SampleDirMixin

View File

@ -8,10 +8,10 @@ from django.core.management import call_command
from django.core.management.base import CommandError from django.core.management.base import CommandError
from django.test import TestCase from django.test import TestCase
from documents.settings import EXPORTER_ARCHIVE_NAME
from documents.settings import EXPORTER_FILE_NAME
from paperless.management.commands.document_importer import Command from paperless.management.commands.document_importer import Command
from paperless.models import Document from paperless.models import Document
from paperless.settings import EXPORTER_ARCHIVE_NAME
from paperless.settings import EXPORTER_FILE_NAME
from paperless.tests.utils import DirectoriesMixin from paperless.tests.utils import DirectoriesMixin
from paperless.tests.utils import FileSystemAssertsMixin from paperless.tests.utils import FileSystemAssertsMixin
from paperless.tests.utils import SampleDirMixin from paperless.tests.utils import SampleDirMixin

View File

@ -119,6 +119,7 @@ simple_png2 = os.path.join(os.path.dirname(__file__), "examples", "no-text.png")
@override_settings(FILENAME_FORMAT="") @override_settings(FILENAME_FORMAT="")
class TestMigrateArchiveFiles(DirectoriesMixin, FileSystemAssertsMixin, TestMigrations): class TestMigrateArchiveFiles(DirectoriesMixin, FileSystemAssertsMixin, TestMigrations):
app = "documents"
migrate_from = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340" migrate_from = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
migrate_to = "1012_fix_archive_files" migrate_to = "1012_fix_archive_files"
@ -286,6 +287,7 @@ def fake_parse_wrapper(parser, path, mime_type, file_name):
@override_settings(FILENAME_FORMAT="") @override_settings(FILENAME_FORMAT="")
class TestMigrateArchiveFilesErrors(DirectoriesMixin, TestMigrations): class TestMigrateArchiveFilesErrors(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340" migrate_from = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
migrate_to = "1012_fix_archive_files" migrate_to = "1012_fix_archive_files"
auto_migrate = False auto_migrate = False
@ -456,6 +458,7 @@ class TestMigrateArchiveFilesBackwards(
FileSystemAssertsMixin, FileSystemAssertsMixin,
TestMigrations, TestMigrations,
): ):
app = "documents"
migrate_from = "1012_fix_archive_files" migrate_from = "1012_fix_archive_files"
migrate_to = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340" migrate_to = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
@ -519,6 +522,7 @@ class TestMigrateArchiveFilesBackwardsWithFilenameFormat(
@override_settings(FILENAME_FORMAT="") @override_settings(FILENAME_FORMAT="")
class TestMigrateArchiveFilesBackwardsErrors(DirectoriesMixin, TestMigrations): class TestMigrateArchiveFilesBackwardsErrors(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1012_fix_archive_files" migrate_from = "1012_fix_archive_files"
migrate_to = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340" migrate_to = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
auto_migrate = False auto_migrate = False

View File

@ -4,6 +4,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateConsumptionTemplate(TestMigrations): class TestMigrateConsumptionTemplate(TestMigrations):
app = "documents"
migrate_from = "1038_sharelink" migrate_from = "1038_sharelink"
migrate_to = "1039_consumptiontemplate" migrate_to = "1039_consumptiontemplate"
@ -24,6 +25,7 @@ class TestMigrateConsumptionTemplate(TestMigrations):
class TestReverseMigrateConsumptionTemplate(TestMigrations): class TestReverseMigrateConsumptionTemplate(TestMigrations):
app = "documents"
migrate_from = "1039_consumptiontemplate" migrate_from = "1039_consumptiontemplate"
migrate_to = "1038_sharelink" migrate_to = "1038_sharelink"

View File

@ -4,6 +4,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateCustomFieldSelects(TestMigrations): class TestMigrateCustomFieldSelects(TestMigrations):
app = "documents"
migrate_from = "1059_workflowactionemail_workflowactionwebhook_and_more" migrate_from = "1059_workflowactionemail_workflowactionwebhook_and_more"
migrate_to = "1060_alter_customfieldinstance_value_select" migrate_to = "1060_alter_customfieldinstance_value_select"
@ -43,6 +44,7 @@ class TestMigrateCustomFieldSelects(TestMigrations):
class TestMigrationCustomFieldSelectsReverse(TestMigrations): class TestMigrationCustomFieldSelectsReverse(TestMigrations):
app = "documents"
migrate_from = "1060_alter_customfieldinstance_value_select" migrate_from = "1060_alter_customfieldinstance_value_select"
migrate_to = "1059_workflowactionemail_workflowactionwebhook_and_more" migrate_to = "1059_workflowactionemail_workflowactionwebhook_and_more"

View File

@ -4,6 +4,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateCustomFields(TestMigrations): class TestMigrateCustomFields(TestMigrations):
app = "documents"
migrate_from = "1039_consumptiontemplate" migrate_from = "1039_consumptiontemplate"
migrate_to = "1040_customfield_customfieldinstance_and_more" migrate_to = "1040_customfield_customfieldinstance_and_more"
@ -24,6 +25,7 @@ class TestMigrateCustomFields(TestMigrations):
class TestReverseMigrateCustomFields(TestMigrations): class TestReverseMigrateCustomFields(TestMigrations):
app = "documents"
migrate_from = "1040_customfield_customfieldinstance_and_more" migrate_from = "1040_customfield_customfieldinstance_and_more"
migrate_to = "1039_consumptiontemplate" migrate_to = "1039_consumptiontemplate"

View File

@ -16,6 +16,7 @@ def source_path_before(self):
class TestMigrateDocumentPageCount(DirectoriesMixin, TestMigrations): class TestMigrateDocumentPageCount(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1052_document_transaction_id" migrate_from = "1052_document_transaction_id"
migrate_to = "1053_document_page_count" migrate_to = "1053_document_page_count"
@ -40,6 +41,7 @@ class TestMigrateDocumentPageCount(DirectoriesMixin, TestMigrations):
class TestMigrateDocumentPageCountBackwards(TestMigrations): class TestMigrateDocumentPageCountBackwards(TestMigrations):
app = "documents"
migrate_from = "1053_document_page_count" migrate_from = "1053_document_page_count"
migrate_to = "1052_document_transaction_id" migrate_to = "1052_document_transaction_id"

View File

@ -22,6 +22,7 @@ migration_1037_obj = importlib.import_module(
) )
@mock.patch(f"{__name__}.migration_1037_obj.run_convert") @mock.patch(f"{__name__}.migration_1037_obj.run_convert")
class TestMigrateToEncrytpedWebPThumbnails(TestMigrations): class TestMigrateToEncrytpedWebPThumbnails(TestMigrations):
app = "documents"
migrate_from = ( migrate_from = (
"1022_paperlesstask_squashed_1036_alter_savedviewfilterrule_rule_type" "1022_paperlesstask_squashed_1036_alter_savedviewfilterrule_rule_type"
) )

View File

@ -40,6 +40,7 @@ def source_path_after(doc):
@override_settings(PASSPHRASE="test") @override_settings(PASSPHRASE="test")
class TestMigrateMimeType(DirectoriesMixin, TestMigrations): class TestMigrateMimeType(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1002_auto_20201111_1105" migrate_from = "1002_auto_20201111_1105"
migrate_to = "1003_mime_types" migrate_to = "1003_mime_types"
@ -85,6 +86,7 @@ class TestMigrateMimeType(DirectoriesMixin, TestMigrations):
@override_settings(PASSPHRASE="test") @override_settings(PASSPHRASE="test")
class TestMigrateMimeTypeBackwards(DirectoriesMixin, TestMigrations): class TestMigrateMimeTypeBackwards(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1003_mime_types" migrate_from = "1003_mime_types"
migrate_to = "1002_auto_20201111_1105" migrate_to = "1002_auto_20201111_1105"

View File

@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateNullCharacters(DirectoriesMixin, TestMigrations): class TestMigrateNullCharacters(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1014_auto_20210228_1614" migrate_from = "1014_auto_20210228_1614"
migrate_to = "1015_remove_null_characters" migrate_to = "1015_remove_null_characters"

View File

@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateStoragePathToTemplate(TestMigrations): class TestMigrateStoragePathToTemplate(TestMigrations):
app = "documents"
migrate_from = "1054_customfieldinstance_value_monetary_amount_and_more" migrate_from = "1054_customfieldinstance_value_monetary_amount_and_more"
migrate_to = "1055_alter_storagepath_path" migrate_to = "1055_alter_storagepath_path"

View File

@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateTagColor(DirectoriesMixin, TestMigrations): class TestMigrateTagColor(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1012_fix_archive_files" migrate_from = "1012_fix_archive_files"
migrate_to = "1013_migrate_tag_colour" migrate_to = "1013_migrate_tag_colour"
@ -20,6 +21,7 @@ class TestMigrateTagColor(DirectoriesMixin, TestMigrations):
class TestMigrateTagColorBackwards(DirectoriesMixin, TestMigrations): class TestMigrateTagColorBackwards(DirectoriesMixin, TestMigrations):
app = "documents"
migrate_from = "1013_migrate_tag_colour" migrate_from = "1013_migrate_tag_colour"
migrate_to = "1012_fix_archive_files" migrate_to = "1012_fix_archive_files"

View File

@ -21,6 +21,7 @@ migration_1021_obj = importlib.import_module(
) )
@mock.patch(f"{__name__}.migration_1021_obj.run_convert") @mock.patch(f"{__name__}.migration_1021_obj.run_convert")
class TestMigrateWebPThumbnails(TestMigrations): class TestMigrateWebPThumbnails(TestMigrations):
app = "documents"
migrate_from = "1016_auto_20210317_1351_squashed_1020_merge_20220518_1839" migrate_from = "1016_auto_20210317_1351_squashed_1020_merge_20220518_1839"
migrate_to = "1021_webp_thumbnail_conversion" migrate_to = "1021_webp_thumbnail_conversion"
auto_migrate = False auto_migrate = False

View File

@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
class TestMigrateWorkflow(TestMigrations): class TestMigrateWorkflow(TestMigrations):
app = "documents"
migrate_from = "1043_alter_savedviewfilterrule_rule_type" migrate_from = "1043_alter_savedviewfilterrule_rule_type"
migrate_to = "1044_workflow_workflowaction_workflowtrigger_and_more" migrate_to = "1044_workflow_workflowaction_workflowtrigger_and_more"
dependencies = ( dependencies = (
@ -82,6 +83,7 @@ class TestMigrateWorkflow(TestMigrations):
class TestReverseMigrateWorkflow(TestMigrations): class TestReverseMigrateWorkflow(TestMigrations):
app = "documents"
migrate_from = "1044_workflow_workflowaction_workflowtrigger_and_more" migrate_from = "1044_workflow_workflowaction_workflowtrigger_and_more"
migrate_to = "1043_alter_savedviewfilterrule_rule_type" migrate_to = "1043_alter_savedviewfilterrule_rule_type"