diff --git a/wagtail_localize/test/migrations/0001_initial.py b/wagtail_localize/test/migrations/0001_initial.py index 5d94cb32..3cac1764 100644 --- a/wagtail_localize/test/migrations/0001_initial.py +++ b/wagtail_localize/test/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.1 on 2022-09-23 14:13 +# Generated by Django 3.2.25 on 2024-03-10 17:20 import uuid @@ -20,12 +20,11 @@ class Migration(migrations.Migration): initial = True - core_migration = "0076_modellogentry_revision" dependencies = [ - ("wagtailcore", "0059_apply_collection_ordering"), - ("wagtaildocs", "0010_document_file_hash"), - ("wagtailimages", "0022_uploadedimage"), - ("wagtail_localize", "0015_translationcontext_field_path"), + ("wagtaildocs", "0012_uploadeddocument"), + ("wagtailimages", "0025_alter_image_file_alter_rendition_file"), + ("wagtailcore", "0089_log_entry_data_json_null_to_object"), + ("wagtail_localize", "0016_rename_page_revision_translationlog_revision"), ] operations = [ @@ -44,6 +43,92 @@ class Migration(migrations.Migration): ("notes", models.CharField(max_length=255)), ], ), + migrations.CreateModel( + name="Header", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "translation_key", + models.UUIDField(default=uuid.uuid4, editable=False), + ), + ("name", models.CharField(blank=True, max_length=100)), + ( + "locale", + models.ForeignKey( + editable=False, + on_delete=django.db.models.deletion.PROTECT, + related_name="+", + to="wagtailcore.locale", + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("translation_key", "locale")}, + }, + ), + migrations.CreateModel( + name="NavigationLink", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "translation_key", + models.UUIDField(default=uuid.uuid4, editable=False), + ), + ( + "sort_order", + models.IntegerField(blank=True, editable=False, null=True), + ), + ("label", models.CharField(max_length=255)), + ( + "locale", + models.ForeignKey( + editable=False, + on_delete=django.db.models.deletion.PROTECT, + related_name="+", + to="wagtailcore.locale", + ), + ), + ( + "page", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailcore.page", + ), + ), + ( + "snippet", + modelcluster.fields.ParentalKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="navigation_links", + to="wagtail_localize_test.header", + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("translation_key", "locale")}, + }, + ), migrations.CreateModel( name="NonTranslatableModel", fields=[ @@ -139,10 +224,7 @@ class Migration(migrations.Migration): ("test_urlblock", wagtail.blocks.URLBlock()), ("test_richtextblock", wagtail.blocks.RichTextBlock()), ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ( - "test_blockquoteblock", - wagtail.blocks.BlockQuoteBlock(), - ), + ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), ( "test_structblock", wagtail.blocks.StructBlock( @@ -208,10 +290,7 @@ class Migration(migrations.Migration): wagtail.blocks.CharBlock() ), ), - ( - "chooser", - wagtail.blocks.PageChooserBlock(), - ), + ("chooser", wagtail.blocks.PageChooserBlock()), ( "chooser_in_struct", wagtail.blocks.StructBlock( @@ -332,8 +411,60 @@ class Migration(migrations.Migration): ] ), ), + ( + "test_chooser_in_struct_in_listblock", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ) + ] + ) + ), + ), + ( + "test_image_chooser_in_listblock", + wagtail.blocks.ListBlock( + wagtail.images.blocks.ImageChooserBlock() + ), + ), + ( + "test_document_chooser_in_listblock", + wagtail.blocks.ListBlock( + wagtail.documents.blocks.DocumentChooserBlock() + ), + ), + ( + "test_chooser_in_struct_in_list_in_stream_in_listblock", + wagtail.blocks.ListBlock( + wagtail.blocks.StreamBlock( + [ + ( + "list", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ) + ] + ) + ), + ) + ] + ) + ), + ), ], blank=True, + use_json_field=True, ), ), ( @@ -460,10 +591,7 @@ class Migration(migrations.Migration): ("test_urlblock", wagtail.blocks.URLBlock()), ("test_richtextblock", wagtail.blocks.RichTextBlock()), ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ( - "test_blockquoteblock", - wagtail.blocks.BlockQuoteBlock(), - ), + ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), ( "test_structblock", wagtail.blocks.StructBlock( @@ -529,10 +657,7 @@ class Migration(migrations.Migration): wagtail.blocks.CharBlock() ), ), - ( - "chooser", - wagtail.blocks.PageChooserBlock(), - ), + ("chooser", wagtail.blocks.PageChooserBlock()), ( "chooser_in_struct", wagtail.blocks.StructBlock( @@ -653,8 +778,60 @@ class Migration(migrations.Migration): ] ), ), + ( + "test_chooser_in_struct_in_listblock", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ) + ] + ) + ), + ), + ( + "test_image_chooser_in_listblock", + wagtail.blocks.ListBlock( + wagtail.images.blocks.ImageChooserBlock() + ), + ), + ( + "test_document_chooser_in_listblock", + wagtail.blocks.ListBlock( + wagtail.documents.blocks.DocumentChooserBlock() + ), + ), + ( + "test_chooser_in_struct_in_list_in_stream_in_listblock", + wagtail.blocks.ListBlock( + wagtail.blocks.StreamBlock( + [ + ( + "list", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ) + ] + ) + ), + ) + ] + ) + ), + ), ], blank=True, + use_json_field=True, ), ), ( @@ -696,10 +873,7 @@ class Migration(migrations.Migration): ("test_urlblock", wagtail.blocks.URLBlock()), ("test_richtextblock", wagtail.blocks.RichTextBlock()), ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ( - "test_blockquoteblock", - wagtail.blocks.BlockQuoteBlock(), - ), + ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), ( "test_structblock", wagtail.blocks.StructBlock( @@ -765,10 +939,7 @@ class Migration(migrations.Migration): wagtail.blocks.CharBlock() ), ), - ( - "chooser", - wagtail.blocks.PageChooserBlock(), - ), + ("chooser", wagtail.blocks.PageChooserBlock()), ( "chooser_in_struct", wagtail.blocks.StructBlock( @@ -889,8 +1060,60 @@ class Migration(migrations.Migration): ] ), ), + ( + "test_chooser_in_struct_in_listblock", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ) + ] + ) + ), + ), + ( + "test_image_chooser_in_listblock", + wagtail.blocks.ListBlock( + wagtail.images.blocks.ImageChooserBlock() + ), + ), + ( + "test_document_chooser_in_listblock", + wagtail.blocks.ListBlock( + wagtail.documents.blocks.DocumentChooserBlock() + ), + ), + ( + "test_chooser_in_struct_in_list_in_stream_in_listblock", + wagtail.blocks.ListBlock( + wagtail.blocks.StreamBlock( + [ + ( + "list", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ) + ] + ) + ), + ) + ] + ) + ), + ), ], blank=True, + use_json_field=True, ), ), ( @@ -949,8 +1172,79 @@ class Migration(migrations.Migration): "translation_key", models.UUIDField(default=uuid.uuid4, editable=False), ), + ( + "live", + models.BooleanField( + default=True, editable=False, verbose_name="live" + ), + ), + ( + "has_unpublished_changes", + models.BooleanField( + default=False, + editable=False, + verbose_name="has unpublished changes", + ), + ), + ( + "first_published_at", + models.DateTimeField( + blank=True, + db_index=True, + null=True, + verbose_name="first published at", + ), + ), + ( + "last_published_at", + models.DateTimeField( + editable=False, null=True, verbose_name="last published at" + ), + ), + ( + "go_live_at", + models.DateTimeField( + blank=True, null=True, verbose_name="go live date/time" + ), + ), + ( + "expire_at", + models.DateTimeField( + blank=True, null=True, verbose_name="expiry date/time" + ), + ), + ( + "expired", + models.BooleanField( + default=False, editable=False, verbose_name="expired" + ), + ), ("field", models.TextField(verbose_name="field")), ("small_charfield", models.CharField(blank=True, max_length=10)), + ( + "latest_revision", + models.ForeignKey( + blank=True, + editable=False, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailcore.revision", + verbose_name="latest revision", + ), + ), + ( + "live_revision", + models.ForeignKey( + blank=True, + editable=False, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailcore.revision", + verbose_name="live revision", + ), + ), ( "locale", models.ForeignKey( @@ -1333,6 +1627,43 @@ class Migration(migrations.Migration): "unique_together": {("translation_key", "locale")}, }, ), + migrations.CreateModel( + name="TestParentalSnippet", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "translation_key", + models.UUIDField(default=uuid.uuid4, editable=False), + ), + ( + "field", + modelcluster.fields.ParentalManyToManyField( + blank=True, to="wagtail_localize_test.TestUUIDModel" + ), + ), + ( + "locale", + models.ForeignKey( + editable=False, + on_delete=django.db.models.deletion.PROTECT, + related_name="+", + to="wagtailcore.locale", + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("translation_key", "locale")}, + }, + ), migrations.CreateModel( name="TestNonParentalChildObject", fields=[ @@ -1377,6 +1708,38 @@ class Migration(migrations.Migration): "unique_together": {("translation_key", "locale")}, }, ), + migrations.CreateModel( + name="TestNoDraftModel", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "translation_key", + models.UUIDField(default=uuid.uuid4, editable=False), + ), + ("field", models.CharField(blank=True, max_length=20)), + ( + "locale", + models.ForeignKey( + editable=False, + on_delete=django.db.models.deletion.PROTECT, + related_name="+", + to="wagtailcore.locale", + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("translation_key", "locale")}, + }, + ), migrations.CreateModel( name="TestModelWithInvalidForeignKey", fields=[ @@ -1460,6 +1823,61 @@ class Migration(migrations.Migration): "unique_together": {("translation_key", "locale")}, }, ), + migrations.CreateModel( + name="SubNavigationLink", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "translation_key", + models.UUIDField(default=uuid.uuid4, editable=False), + ), + ( + "sort_order", + models.IntegerField(blank=True, editable=False, null=True), + ), + ("label", models.CharField(max_length=255)), + ( + "locale", + models.ForeignKey( + editable=False, + on_delete=django.db.models.deletion.PROTECT, + related_name="+", + to="wagtailcore.locale", + ), + ), + ( + "page", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailcore.page", + ), + ), + ( + "sub_nav", + modelcluster.fields.ParentalKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="sub_navigation_links", + to="wagtail_localize_test.navigationlink", + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("translation_key", "locale")}, + }, + ), migrations.CreateModel( name="PageWithCustomEditHandlerChildObject", fields=[ diff --git a/wagtail_localize/test/migrations/0002_header_navigationlink_and_more.py b/wagtail_localize/test/migrations/0002_header_navigationlink_and_more.py deleted file mode 100644 index b4352fcf..00000000 --- a/wagtail_localize/test/migrations/0002_header_navigationlink_and_more.py +++ /dev/null @@ -1,921 +0,0 @@ -# Generated by Django 3.2.16 on 2022-10-17 20:32 - -import uuid - -import django.db.models.deletion -import modelcluster.fields -import wagtail.blocks -import wagtail.blocks.field_block -import wagtail.documents.blocks -import wagtail.embeds.blocks -import wagtail.fields -import wagtail.images.blocks -import wagtail.snippets.blocks - -from django.db import migrations, models - -import wagtail_localize.test.models - - -class Migration(migrations.Migration): - dependencies = [ - ("wagtailcore", "0066_collection_management_permissions"), - ("wagtail_localize_test", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="Header", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "translation_key", - models.UUIDField(default=uuid.uuid4, editable=False), - ), - ("name", models.CharField(max_length=100, blank=True)), - ( - "locale", - models.ForeignKey( - editable=False, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailcore.locale", - ), - ), - ], - options={ - "abstract": False, - "unique_together": {("translation_key", "locale")}, - }, - ), - migrations.CreateModel( - name="NavigationLink", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "translation_key", - models.UUIDField(default=uuid.uuid4, editable=False), - ), - ( - "sort_order", - models.IntegerField(blank=True, editable=False, null=True), - ), - ("label", models.CharField(max_length=255)), - ( - "locale", - models.ForeignKey( - editable=False, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailcore.locale", - ), - ), - ( - "page", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailcore.page", - ), - ), - ( - "snippet", - modelcluster.fields.ParentalKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="navigation_links", - to="wagtail_localize_test.header", - ), - ), - ], - options={ - "abstract": False, - "unique_together": {("translation_key", "locale")}, - }, - ), - migrations.AlterField( - model_name="testgeneratetranslatablefieldspage", - name="test_streamfield", - field=wagtail.fields.StreamField( - [ - ("test_charblock", wagtail.blocks.CharBlock(max_length=255)), - ( - "test_textblock", - wagtail.blocks.TextBlock(label="text block"), - ), - ("test_emailblock", wagtail.blocks.EmailBlock()), - ("test_urlblock", wagtail.blocks.URLBlock()), - ("test_richtextblock", wagtail.blocks.RichTextBlock()), - ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), - ( - "test_structblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_listblock", - wagtail.blocks.ListBlock(wagtail.blocks.TextBlock()), - ), - ( - "test_listblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(required=False), - ), - ( - "items", - wagtail.blocks.ListBlock( - wagtail.blocks.field_block.CharBlock - ), - ), - ( - "links_list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - blank=True, - label="List Heading", - required=False, - ), - ), - ( - "pages", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ) - ), - ), - ] - ), - ), - ( - "test_nestedstreamblock", - wagtail.blocks.StreamBlock( - [ - ("block_a", wagtail.blocks.TextBlock()), - ("block_b", wagtail.blocks.TextBlock()), - ( - "block_l", - wagtail.blocks.ListBlock( - wagtail.blocks.CharBlock() - ), - ), - ("chooser", wagtail.blocks.PageChooserBlock()), - ( - "chooser_in_struct", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ( - "chooser_in_list", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ), - ), - ( - "test_streamblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_stream", - wagtail.blocks.StreamBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ), - ( - "checklist", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ] - ), - ) - ] - ), - ), - ( - "test_customstructblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_customblockwithoutextractmethod", - wagtail_localize.test.models.CustomBlockWithoutExtractMethod(), - ), - ("test_pagechooserblock", wagtail.blocks.PageChooserBlock()), - ( - "test_pagechooserblock_with_restricted_types", - wagtail.blocks.PageChooserBlock( - [ - "wagtail_localize_test.TestHomePage", - "wagtail_localize_test.TestPage", - ] - ), - ), - ( - "test_imagechooserblock", - wagtail.images.blocks.ImageChooserBlock(), - ), - ( - "test_documentchooserblock", - wagtail.documents.blocks.DocumentChooserBlock(), - ), - ( - "test_snippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.TestSnippet - ), - ), - ( - "test_nontranslatablesnippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.NonTranslatableSnippet - ), - ), - ("test_embedblock", wagtail.embeds.blocks.EmbedBlock()), - ( - "test_chooserstructblock", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "test_nestedchooserstructblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_page", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ) - ] - ), - ), - ( - "test_chooser_in_struct_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(required=False), - ) - ] - ) - ), - ), - ( - "test_image_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.images.blocks.ImageChooserBlock() - ), - ), - ( - "test_document_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.documents.blocks.DocumentChooserBlock() - ), - ), - ( - "test_chooser_in_struct_in_list_in_stream_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StreamBlock( - [ - ( - "list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock( - required=False - ), - ) - ] - ) - ), - ) - ] - ) - ), - ), - ], - blank=True, - ), - ), - migrations.AlterField( - model_name="testpage", - name="test_streamfield", - field=wagtail.fields.StreamField( - [ - ("test_charblock", wagtail.blocks.CharBlock(max_length=255)), - ( - "test_textblock", - wagtail.blocks.TextBlock(label="text block"), - ), - ("test_emailblock", wagtail.blocks.EmailBlock()), - ("test_urlblock", wagtail.blocks.URLBlock()), - ("test_richtextblock", wagtail.blocks.RichTextBlock()), - ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), - ( - "test_structblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_listblock", - wagtail.blocks.ListBlock(wagtail.blocks.TextBlock()), - ), - ( - "test_listblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(required=False), - ), - ( - "items", - wagtail.blocks.ListBlock( - wagtail.blocks.field_block.CharBlock - ), - ), - ( - "links_list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - blank=True, - label="List Heading", - required=False, - ), - ), - ( - "pages", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ) - ), - ), - ] - ), - ), - ( - "test_nestedstreamblock", - wagtail.blocks.StreamBlock( - [ - ("block_a", wagtail.blocks.TextBlock()), - ("block_b", wagtail.blocks.TextBlock()), - ( - "block_l", - wagtail.blocks.ListBlock( - wagtail.blocks.CharBlock() - ), - ), - ("chooser", wagtail.blocks.PageChooserBlock()), - ( - "chooser_in_struct", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ( - "chooser_in_list", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ), - ), - ( - "test_streamblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_stream", - wagtail.blocks.StreamBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ), - ( - "checklist", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ] - ), - ) - ] - ), - ), - ( - "test_customstructblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_customblockwithoutextractmethod", - wagtail_localize.test.models.CustomBlockWithoutExtractMethod(), - ), - ("test_pagechooserblock", wagtail.blocks.PageChooserBlock()), - ( - "test_pagechooserblock_with_restricted_types", - wagtail.blocks.PageChooserBlock( - [ - "wagtail_localize_test.TestHomePage", - "wagtail_localize_test.TestPage", - ] - ), - ), - ( - "test_imagechooserblock", - wagtail.images.blocks.ImageChooserBlock(), - ), - ( - "test_documentchooserblock", - wagtail.documents.blocks.DocumentChooserBlock(), - ), - ( - "test_snippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.TestSnippet - ), - ), - ( - "test_nontranslatablesnippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.NonTranslatableSnippet - ), - ), - ("test_embedblock", wagtail.embeds.blocks.EmbedBlock()), - ( - "test_chooserstructblock", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "test_nestedchooserstructblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_page", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ) - ] - ), - ), - ( - "test_chooser_in_struct_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(required=False), - ) - ] - ) - ), - ), - ( - "test_image_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.images.blocks.ImageChooserBlock() - ), - ), - ( - "test_document_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.documents.blocks.DocumentChooserBlock() - ), - ), - ( - "test_chooser_in_struct_in_list_in_stream_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StreamBlock( - [ - ( - "list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock( - required=False - ), - ) - ] - ) - ), - ) - ] - ) - ), - ), - ], - blank=True, - ), - ), - migrations.AlterField( - model_name="testpage", - name="test_synchronized_streamfield", - field=wagtail.fields.StreamField( - [ - ("test_charblock", wagtail.blocks.CharBlock(max_length=255)), - ( - "test_textblock", - wagtail.blocks.TextBlock(label="text block"), - ), - ("test_emailblock", wagtail.blocks.EmailBlock()), - ("test_urlblock", wagtail.blocks.URLBlock()), - ("test_richtextblock", wagtail.blocks.RichTextBlock()), - ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), - ( - "test_structblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_listblock", - wagtail.blocks.ListBlock(wagtail.blocks.TextBlock()), - ), - ( - "test_listblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(required=False), - ), - ( - "items", - wagtail.blocks.ListBlock( - wagtail.blocks.field_block.CharBlock - ), - ), - ( - "links_list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - blank=True, - label="List Heading", - required=False, - ), - ), - ( - "pages", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ) - ), - ), - ] - ), - ), - ( - "test_nestedstreamblock", - wagtail.blocks.StreamBlock( - [ - ("block_a", wagtail.blocks.TextBlock()), - ("block_b", wagtail.blocks.TextBlock()), - ( - "block_l", - wagtail.blocks.ListBlock( - wagtail.blocks.CharBlock() - ), - ), - ("chooser", wagtail.blocks.PageChooserBlock()), - ( - "chooser_in_struct", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ( - "chooser_in_list", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ), - ), - ( - "test_streamblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_stream", - wagtail.blocks.StreamBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ), - ( - "checklist", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ] - ), - ) - ] - ), - ), - ( - "test_customstructblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_customblockwithoutextractmethod", - wagtail_localize.test.models.CustomBlockWithoutExtractMethod(), - ), - ("test_pagechooserblock", wagtail.blocks.PageChooserBlock()), - ( - "test_pagechooserblock_with_restricted_types", - wagtail.blocks.PageChooserBlock( - [ - "wagtail_localize_test.TestHomePage", - "wagtail_localize_test.TestPage", - ] - ), - ), - ( - "test_imagechooserblock", - wagtail.images.blocks.ImageChooserBlock(), - ), - ( - "test_documentchooserblock", - wagtail.documents.blocks.DocumentChooserBlock(), - ), - ( - "test_snippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.TestSnippet - ), - ), - ( - "test_nontranslatablesnippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.NonTranslatableSnippet - ), - ), - ("test_embedblock", wagtail.embeds.blocks.EmbedBlock()), - ( - "test_chooserstructblock", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "test_nestedchooserstructblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_page", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ) - ] - ), - ), - ( - "test_chooser_in_struct_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(required=False), - ) - ] - ) - ), - ), - ( - "test_image_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.images.blocks.ImageChooserBlock() - ), - ), - ( - "test_document_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.documents.blocks.DocumentChooserBlock() - ), - ), - ( - "test_chooser_in_struct_in_list_in_stream_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StreamBlock( - [ - ( - "list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock( - required=False - ), - ) - ] - ) - ), - ) - ] - ) - ), - ), - ], - blank=True, - ), - ), - migrations.CreateModel( - name="SubNavigationLink", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "translation_key", - models.UUIDField(default=uuid.uuid4, editable=False), - ), - ( - "sort_order", - models.IntegerField(blank=True, editable=False, null=True), - ), - ("label", models.CharField(max_length=255)), - ( - "locale", - models.ForeignKey( - editable=False, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailcore.locale", - ), - ), - ( - "page", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailcore.page", - ), - ), - ( - "sub_nav", - modelcluster.fields.ParentalKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="sub_navigation_links", - to="wagtail_localize_test.navigationlink", - ), - ), - ], - options={ - "abstract": False, - "unique_together": {("translation_key", "locale")}, - }, - ), - ] diff --git a/wagtail_localize/test/migrations/0003_wagtail_3_use_json_field.py b/wagtail_localize/test/migrations/0003_wagtail_3_use_json_field.py deleted file mode 100644 index 45cf9853..00000000 --- a/wagtail_localize/test/migrations/0003_wagtail_3_use_json_field.py +++ /dev/null @@ -1,721 +0,0 @@ -# Generated by Django 4.1.9 on 2023-05-24 15:10 - -import wagtail.blocks -import wagtail.blocks.field_block -import wagtail.documents.blocks -import wagtail.embeds.blocks -import wagtail.fields -import wagtail.images.blocks -import wagtail.snippets.blocks - -from django.db import migrations - -import wagtail_localize.test.models - - -class Migration(migrations.Migration): - dependencies = [ - ("wagtail_localize_test", "0002_header_navigationlink_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="testgeneratetranslatablefieldspage", - name="test_streamfield", - field=wagtail.fields.StreamField( - [ - ("test_charblock", wagtail.blocks.CharBlock(max_length=255)), - ("test_textblock", wagtail.blocks.TextBlock(label="text block")), - ("test_emailblock", wagtail.blocks.EmailBlock()), - ("test_urlblock", wagtail.blocks.URLBlock()), - ("test_richtextblock", wagtail.blocks.RichTextBlock()), - ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), - ( - "test_structblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_listblock", - wagtail.blocks.ListBlock(wagtail.blocks.TextBlock()), - ), - ( - "test_listblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.CharBlock(required=False)), - ( - "items", - wagtail.blocks.ListBlock( - wagtail.blocks.field_block.CharBlock - ), - ), - ( - "links_list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - blank=True, - label="List Heading", - required=False, - ), - ), - ( - "pages", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ) - ), - ), - ] - ), - ), - ( - "test_nestedstreamblock", - wagtail.blocks.StreamBlock( - [ - ("block_a", wagtail.blocks.TextBlock()), - ("block_b", wagtail.blocks.TextBlock()), - ( - "block_l", - wagtail.blocks.ListBlock( - wagtail.blocks.CharBlock() - ), - ), - ("chooser", wagtail.blocks.PageChooserBlock()), - ( - "chooser_in_struct", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "chooser_in_list", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ), - ), - ( - "test_streamblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_stream", - wagtail.blocks.StreamBlock( - [ - ("page", wagtail.blocks.PageChooserBlock()), - ( - "checklist", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ] - ), - ) - ] - ), - ), - ( - "test_customstructblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_customblockwithoutextractmethod", - wagtail_localize.test.models.CustomBlockWithoutExtractMethod(), - ), - ("test_pagechooserblock", wagtail.blocks.PageChooserBlock()), - ( - "test_pagechooserblock_with_restricted_types", - wagtail.blocks.PageChooserBlock( - [ - "wagtail_localize_test.TestHomePage", - "wagtail_localize_test.TestPage", - ] - ), - ), - ( - "test_imagechooserblock", - wagtail.images.blocks.ImageChooserBlock(), - ), - ( - "test_documentchooserblock", - wagtail.documents.blocks.DocumentChooserBlock(), - ), - ( - "test_snippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.TestSnippet - ), - ), - ( - "test_nontranslatablesnippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.NonTranslatableSnippet - ), - ), - ("test_embedblock", wagtail.embeds.blocks.EmbedBlock()), - ( - "test_chooserstructblock", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "test_nestedchooserstructblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_page", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ) - ] - ), - ), - ( - "test_chooser_in_struct_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(required=False), - ) - ] - ) - ), - ), - ( - "test_image_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.images.blocks.ImageChooserBlock() - ), - ), - ( - "test_document_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.documents.blocks.DocumentChooserBlock() - ), - ), - ( - "test_chooser_in_struct_in_list_in_stream_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StreamBlock( - [ - ( - "list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock( - required=False - ), - ) - ] - ) - ), - ) - ] - ) - ), - ), - ], - blank=True, - use_json_field=True, - ), - ), - migrations.AlterField( - model_name="testpage", - name="test_streamfield", - field=wagtail.fields.StreamField( - [ - ("test_charblock", wagtail.blocks.CharBlock(max_length=255)), - ("test_textblock", wagtail.blocks.TextBlock(label="text block")), - ("test_emailblock", wagtail.blocks.EmailBlock()), - ("test_urlblock", wagtail.blocks.URLBlock()), - ("test_richtextblock", wagtail.blocks.RichTextBlock()), - ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), - ( - "test_structblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_listblock", - wagtail.blocks.ListBlock(wagtail.blocks.TextBlock()), - ), - ( - "test_listblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.CharBlock(required=False)), - ( - "items", - wagtail.blocks.ListBlock( - wagtail.blocks.field_block.CharBlock - ), - ), - ( - "links_list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - blank=True, - label="List Heading", - required=False, - ), - ), - ( - "pages", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ) - ), - ), - ] - ), - ), - ( - "test_nestedstreamblock", - wagtail.blocks.StreamBlock( - [ - ("block_a", wagtail.blocks.TextBlock()), - ("block_b", wagtail.blocks.TextBlock()), - ( - "block_l", - wagtail.blocks.ListBlock( - wagtail.blocks.CharBlock() - ), - ), - ("chooser", wagtail.blocks.PageChooserBlock()), - ( - "chooser_in_struct", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "chooser_in_list", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ), - ), - ( - "test_streamblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_stream", - wagtail.blocks.StreamBlock( - [ - ("page", wagtail.blocks.PageChooserBlock()), - ( - "checklist", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ] - ), - ) - ] - ), - ), - ( - "test_customstructblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_customblockwithoutextractmethod", - wagtail_localize.test.models.CustomBlockWithoutExtractMethod(), - ), - ("test_pagechooserblock", wagtail.blocks.PageChooserBlock()), - ( - "test_pagechooserblock_with_restricted_types", - wagtail.blocks.PageChooserBlock( - [ - "wagtail_localize_test.TestHomePage", - "wagtail_localize_test.TestPage", - ] - ), - ), - ( - "test_imagechooserblock", - wagtail.images.blocks.ImageChooserBlock(), - ), - ( - "test_documentchooserblock", - wagtail.documents.blocks.DocumentChooserBlock(), - ), - ( - "test_snippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.TestSnippet - ), - ), - ( - "test_nontranslatablesnippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.NonTranslatableSnippet - ), - ), - ("test_embedblock", wagtail.embeds.blocks.EmbedBlock()), - ( - "test_chooserstructblock", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "test_nestedchooserstructblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_page", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ) - ] - ), - ), - ( - "test_chooser_in_struct_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(required=False), - ) - ] - ) - ), - ), - ( - "test_image_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.images.blocks.ImageChooserBlock() - ), - ), - ( - "test_document_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.documents.blocks.DocumentChooserBlock() - ), - ), - ( - "test_chooser_in_struct_in_list_in_stream_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StreamBlock( - [ - ( - "list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock( - required=False - ), - ) - ] - ) - ), - ) - ] - ) - ), - ), - ], - blank=True, - use_json_field=True, - ), - ), - migrations.AlterField( - model_name="testpage", - name="test_synchronized_streamfield", - field=wagtail.fields.StreamField( - [ - ("test_charblock", wagtail.blocks.CharBlock(max_length=255)), - ("test_textblock", wagtail.blocks.TextBlock(label="text block")), - ("test_emailblock", wagtail.blocks.EmailBlock()), - ("test_urlblock", wagtail.blocks.URLBlock()), - ("test_richtextblock", wagtail.blocks.RichTextBlock()), - ("test_rawhtmlblock", wagtail.blocks.RawHTMLBlock()), - ("test_blockquoteblock", wagtail.blocks.BlockQuoteBlock()), - ( - "test_structblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_listblock", - wagtail.blocks.ListBlock(wagtail.blocks.TextBlock()), - ), - ( - "test_listblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.CharBlock(required=False)), - ( - "items", - wagtail.blocks.ListBlock( - wagtail.blocks.field_block.CharBlock - ), - ), - ( - "links_list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - blank=True, - label="List Heading", - required=False, - ), - ), - ( - "pages", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ) - ), - ), - ] - ), - ), - ( - "test_nestedstreamblock", - wagtail.blocks.StreamBlock( - [ - ("block_a", wagtail.blocks.TextBlock()), - ("block_b", wagtail.blocks.TextBlock()), - ( - "block_l", - wagtail.blocks.ListBlock( - wagtail.blocks.CharBlock() - ), - ), - ("chooser", wagtail.blocks.PageChooserBlock()), - ( - "chooser_in_struct", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "chooser_in_list", - wagtail.blocks.ListBlock( - wagtail.blocks.PageChooserBlock() - ), - ), - ] - ), - ), - ( - "test_streamblock_in_structblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_stream", - wagtail.blocks.StreamBlock( - [ - ("page", wagtail.blocks.PageChooserBlock()), - ( - "checklist", - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(), - ) - ] - ), - ), - ] - ), - ) - ] - ), - ), - ( - "test_customstructblock", - wagtail.blocks.StructBlock( - [ - ("field_a", wagtail.blocks.TextBlock()), - ("field_b", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test_customblockwithoutextractmethod", - wagtail_localize.test.models.CustomBlockWithoutExtractMethod(), - ), - ("test_pagechooserblock", wagtail.blocks.PageChooserBlock()), - ( - "test_pagechooserblock_with_restricted_types", - wagtail.blocks.PageChooserBlock( - [ - "wagtail_localize_test.TestHomePage", - "wagtail_localize_test.TestPage", - ] - ), - ), - ( - "test_imagechooserblock", - wagtail.images.blocks.ImageChooserBlock(), - ), - ( - "test_documentchooserblock", - wagtail.documents.blocks.DocumentChooserBlock(), - ), - ( - "test_snippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.TestSnippet - ), - ), - ( - "test_nontranslatablesnippetchooserblock", - wagtail.snippets.blocks.SnippetChooserBlock( - wagtail_localize.test.models.NonTranslatableSnippet - ), - ), - ("test_embedblock", wagtail.embeds.blocks.EmbedBlock()), - ( - "test_chooserstructblock", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ), - ( - "test_nestedchooserstructblock", - wagtail.blocks.StructBlock( - [ - ( - "nested_page", - wagtail.blocks.StructBlock( - [("page", wagtail.blocks.PageChooserBlock())] - ), - ) - ] - ), - ), - ( - "test_chooser_in_struct_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock(required=False), - ) - ] - ) - ), - ), - ( - "test_image_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.images.blocks.ImageChooserBlock() - ), - ), - ( - "test_document_chooser_in_listblock", - wagtail.blocks.ListBlock( - wagtail.documents.blocks.DocumentChooserBlock() - ), - ), - ( - "test_chooser_in_struct_in_list_in_stream_in_listblock", - wagtail.blocks.ListBlock( - wagtail.blocks.StreamBlock( - [ - ( - "list", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "page", - wagtail.blocks.PageChooserBlock( - required=False - ), - ) - ] - ) - ), - ) - ] - ) - ), - ), - ], - blank=True, - use_json_field=True, - ), - ), - ] diff --git a/wagtail_localize/test/migrations/0004_testparentalsnippet.py b/wagtail_localize/test/migrations/0004_testparentalsnippet.py deleted file mode 100644 index 67a628d4..00000000 --- a/wagtail_localize/test/migrations/0004_testparentalsnippet.py +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by Django 3.2.5 on 2022-05-06 18:53 - -import uuid - -import django.db.models.deletion -import modelcluster.fields - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("wagtail_localize_test", "0003_wagtail_3_use_json_field"), - ] - - operations = [ - migrations.CreateModel( - name="TestParentalSnippet", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "translation_key", - models.UUIDField(default=uuid.uuid4, editable=False), - ), - ( - "field", - modelcluster.fields.ParentalManyToManyField( - blank=True, to="wagtail_localize_test.TestUUIDModel" - ), - ), - ( - "locale", - models.ForeignKey( - editable=False, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailcore.locale", - ), - ), - ], - options={ - "abstract": False, - "unique_together": {("translation_key", "locale")}, - }, - ), - ] diff --git a/wagtail_localize/test/migrations/0005_testsnippet_expire_at_testsnippet_expired_and_more.py b/wagtail_localize/test/migrations/0005_testsnippet_expire_at_testsnippet_expired_and_more.py deleted file mode 100644 index 0f6d3705..00000000 --- a/wagtail_localize/test/migrations/0005_testsnippet_expire_at_testsnippet_expired_and_more.py +++ /dev/null @@ -1,124 +0,0 @@ -# Generated by Django 4.2.9 on 2024-01-06 13:20 - -import uuid - -import django.db.models.deletion - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("wagtailcore", "0077_alter_revision_user"), - ("wagtail_localize_test", "0004_testparentalsnippet"), - ] - - operations = [ - migrations.AddField( - model_name="testsnippet", - name="expire_at", - field=models.DateTimeField( - blank=True, null=True, verbose_name="expiry date/time" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="expired", - field=models.BooleanField( - default=False, editable=False, verbose_name="expired" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="first_published_at", - field=models.DateTimeField( - blank=True, db_index=True, null=True, verbose_name="first published at" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="go_live_at", - field=models.DateTimeField( - blank=True, null=True, verbose_name="go live date/time" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="has_unpublished_changes", - field=models.BooleanField( - default=False, editable=False, verbose_name="has unpublished changes" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="last_published_at", - field=models.DateTimeField( - editable=False, null=True, verbose_name="last published at" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="latest_revision", - field=models.ForeignKey( - blank=True, - editable=False, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailcore.revision", - verbose_name="latest revision", - ), - ), - migrations.AddField( - model_name="testsnippet", - name="live", - field=models.BooleanField( - default=True, editable=False, verbose_name="live" - ), - ), - migrations.AddField( - model_name="testsnippet", - name="live_revision", - field=models.ForeignKey( - blank=True, - editable=False, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailcore.revision", - verbose_name="live revision", - ), - ), - migrations.CreateModel( - name="TestNoDraftModel", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "translation_key", - models.UUIDField(default=uuid.uuid4, editable=False), - ), - ("field", models.CharField(blank=True, max_length=10)), - ( - "locale", - models.ForeignKey( - editable=False, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailcore.locale", - ), - ), - ], - options={ - "abstract": False, - "unique_together": {("translation_key", "locale")}, - }, - ), - ] diff --git a/wagtail_localize/test/models.py b/wagtail_localize/test/models.py index 8340d2b7..bd84561c 100644 --- a/wagtail_localize/test/models.py +++ b/wagtail_localize/test/models.py @@ -52,7 +52,7 @@ class TestSnippet(TranslatableMixin, DraftStateMixin, RevisionMixin, Clusterable class TestNoDraftModel(TranslatableMixin): - field = models.CharField(max_length=10, blank=True) + field = models.CharField(max_length=20, blank=True) translatable_fields = [ TranslatableField("field"),