mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-17 12:32:12 -05:00
See if this fixes migration tests
This commit is contained in:
parent
8891d5ca16
commit
571f3b4ab2
@ -24,7 +24,6 @@ from guardian.models import GroupObjectPermission
|
||||
from guardian.models import UserObjectPermission
|
||||
from guardian.shortcuts import assign_perm
|
||||
|
||||
from documents.settings import EXPORTER_FILE_NAME
|
||||
from paperless.management.commands import document_exporter
|
||||
from paperless.models import Correspondent
|
||||
from paperless.models import CustomField
|
||||
@ -39,6 +38,7 @@ from paperless.models import Workflow
|
||||
from paperless.models import WorkflowAction
|
||||
from paperless.models import WorkflowTrigger
|
||||
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 FileSystemAssertsMixin
|
||||
from paperless.tests.utils import SampleDirMixin
|
||||
|
@ -8,10 +8,10 @@ from django.core.management import call_command
|
||||
from django.core.management.base import CommandError
|
||||
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.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 FileSystemAssertsMixin
|
||||
from paperless.tests.utils import SampleDirMixin
|
||||
|
@ -119,6 +119,7 @@ simple_png2 = os.path.join(os.path.dirname(__file__), "examples", "no-text.png")
|
||||
|
||||
@override_settings(FILENAME_FORMAT="")
|
||||
class TestMigrateArchiveFiles(DirectoriesMixin, FileSystemAssertsMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
|
||||
migrate_to = "1012_fix_archive_files"
|
||||
|
||||
@ -286,6 +287,7 @@ def fake_parse_wrapper(parser, path, mime_type, file_name):
|
||||
|
||||
@override_settings(FILENAME_FORMAT="")
|
||||
class TestMigrateArchiveFilesErrors(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
|
||||
migrate_to = "1012_fix_archive_files"
|
||||
auto_migrate = False
|
||||
@ -456,6 +458,7 @@ class TestMigrateArchiveFilesBackwards(
|
||||
FileSystemAssertsMixin,
|
||||
TestMigrations,
|
||||
):
|
||||
app = "documents"
|
||||
migrate_from = "1012_fix_archive_files"
|
||||
migrate_to = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
|
||||
|
||||
@ -519,6 +522,7 @@ class TestMigrateArchiveFilesBackwardsWithFilenameFormat(
|
||||
|
||||
@override_settings(FILENAME_FORMAT="")
|
||||
class TestMigrateArchiveFilesBackwardsErrors(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1012_fix_archive_files"
|
||||
migrate_to = "1006_auto_20201208_2209_squashed_1011_auto_20210101_2340"
|
||||
auto_migrate = False
|
||||
|
@ -4,6 +4,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateConsumptionTemplate(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1038_sharelink"
|
||||
migrate_to = "1039_consumptiontemplate"
|
||||
|
||||
@ -24,6 +25,7 @@ class TestMigrateConsumptionTemplate(TestMigrations):
|
||||
|
||||
|
||||
class TestReverseMigrateConsumptionTemplate(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1039_consumptiontemplate"
|
||||
migrate_to = "1038_sharelink"
|
||||
|
||||
|
@ -4,6 +4,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateCustomFieldSelects(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1059_workflowactionemail_workflowactionwebhook_and_more"
|
||||
migrate_to = "1060_alter_customfieldinstance_value_select"
|
||||
|
||||
@ -43,6 +44,7 @@ class TestMigrateCustomFieldSelects(TestMigrations):
|
||||
|
||||
|
||||
class TestMigrationCustomFieldSelectsReverse(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1060_alter_customfieldinstance_value_select"
|
||||
migrate_to = "1059_workflowactionemail_workflowactionwebhook_and_more"
|
||||
|
||||
|
@ -4,6 +4,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateCustomFields(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1039_consumptiontemplate"
|
||||
migrate_to = "1040_customfield_customfieldinstance_and_more"
|
||||
|
||||
@ -24,6 +25,7 @@ class TestMigrateCustomFields(TestMigrations):
|
||||
|
||||
|
||||
class TestReverseMigrateCustomFields(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1040_customfield_customfieldinstance_and_more"
|
||||
migrate_to = "1039_consumptiontemplate"
|
||||
|
||||
|
@ -16,6 +16,7 @@ def source_path_before(self):
|
||||
|
||||
|
||||
class TestMigrateDocumentPageCount(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1052_document_transaction_id"
|
||||
migrate_to = "1053_document_page_count"
|
||||
|
||||
@ -40,6 +41,7 @@ class TestMigrateDocumentPageCount(DirectoriesMixin, TestMigrations):
|
||||
|
||||
|
||||
class TestMigrateDocumentPageCountBackwards(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1053_document_page_count"
|
||||
migrate_to = "1052_document_transaction_id"
|
||||
|
||||
|
@ -22,6 +22,7 @@ migration_1037_obj = importlib.import_module(
|
||||
)
|
||||
@mock.patch(f"{__name__}.migration_1037_obj.run_convert")
|
||||
class TestMigrateToEncrytpedWebPThumbnails(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = (
|
||||
"1022_paperlesstask_squashed_1036_alter_savedviewfilterrule_rule_type"
|
||||
)
|
||||
|
@ -40,6 +40,7 @@ def source_path_after(doc):
|
||||
|
||||
@override_settings(PASSPHRASE="test")
|
||||
class TestMigrateMimeType(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1002_auto_20201111_1105"
|
||||
migrate_to = "1003_mime_types"
|
||||
|
||||
@ -85,6 +86,7 @@ class TestMigrateMimeType(DirectoriesMixin, TestMigrations):
|
||||
|
||||
@override_settings(PASSPHRASE="test")
|
||||
class TestMigrateMimeTypeBackwards(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1003_mime_types"
|
||||
migrate_to = "1002_auto_20201111_1105"
|
||||
|
||||
|
@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateNullCharacters(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1014_auto_20210228_1614"
|
||||
migrate_to = "1015_remove_null_characters"
|
||||
|
||||
|
@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateStoragePathToTemplate(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1054_customfieldinstance_value_monetary_amount_and_more"
|
||||
migrate_to = "1055_alter_storagepath_path"
|
||||
|
||||
|
@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateTagColor(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1012_fix_archive_files"
|
||||
migrate_to = "1013_migrate_tag_colour"
|
||||
|
||||
@ -20,6 +21,7 @@ class TestMigrateTagColor(DirectoriesMixin, TestMigrations):
|
||||
|
||||
|
||||
class TestMigrateTagColorBackwards(DirectoriesMixin, TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1013_migrate_tag_colour"
|
||||
migrate_to = "1012_fix_archive_files"
|
||||
|
||||
|
@ -21,6 +21,7 @@ migration_1021_obj = importlib.import_module(
|
||||
)
|
||||
@mock.patch(f"{__name__}.migration_1021_obj.run_convert")
|
||||
class TestMigrateWebPThumbnails(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1016_auto_20210317_1351_squashed_1020_merge_20220518_1839"
|
||||
migrate_to = "1021_webp_thumbnail_conversion"
|
||||
auto_migrate = False
|
||||
|
@ -3,6 +3,7 @@ from paperless.tests.utils import TestMigrations
|
||||
|
||||
|
||||
class TestMigrateWorkflow(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1043_alter_savedviewfilterrule_rule_type"
|
||||
migrate_to = "1044_workflow_workflowaction_workflowtrigger_and_more"
|
||||
dependencies = (
|
||||
@ -82,6 +83,7 @@ class TestMigrateWorkflow(TestMigrations):
|
||||
|
||||
|
||||
class TestReverseMigrateWorkflow(TestMigrations):
|
||||
app = "documents"
|
||||
migrate_from = "1044_workflow_workflowaction_workflowtrigger_and_more"
|
||||
migrate_to = "1043_alter_savedviewfilterrule_rule_type"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user