diff --git a/network-api/networkapi/reports/tests/test_block_type_report.py b/network-api/networkapi/reports/tests/test_block_type_report.py index 55e76791910..ffe2d9f95aa 100644 --- a/network-api/networkapi/reports/tests/test_block_type_report.py +++ b/network-api/networkapi/reports/tests/test_block_type_report.py @@ -84,10 +84,12 @@ def test_view(self): self.assertListEqual([primary_page.content_type, campaign_page.content_type], block["content_types"]) block = object_list[3] - self.assertEqual(block["block"], "wagtail.blocks.field_block.CharBlock") + self.assertEqual( + block["block"], "networkapi.wagtailpages.pagemodels.customblocks.link_block.LinkWithoutLabelBlock" + ) self.assertEqual(block["count"], 2) - self.assertEqual(block["type_label"], "Core") - self.assertFalse(block["is_custom_block"]) + self.assertEqual(block["type_label"], "Custom") + self.assertTrue(block["is_custom_block"]) self.assertListEqual([primary_page.content_type, campaign_page.content_type], block["content_types"]) block = object_list[4] @@ -176,10 +178,12 @@ def test_page_unpublished(self): self.assertListEqual([campaign_page.content_type], block["content_types"]) block = object_list[3] - self.assertEqual(block["block"], "wagtail.blocks.field_block.CharBlock") + self.assertEqual( + block["block"], "networkapi.wagtailpages.pagemodels.customblocks.link_block.LinkWithoutLabelBlock" + ) self.assertEqual(block["count"], 1) - self.assertEqual(block["type_label"], "Core") - self.assertFalse(block["is_custom_block"]) + self.assertEqual(block["type_label"], "Custom") + self.assertTrue(block["is_custom_block"]) self.assertListEqual([campaign_page.content_type], block["content_types"]) block = object_list[4] @@ -225,7 +229,7 @@ def test_page_deleted(self): ) # Two pages have crated ImageBlocks - # Each ImageBlock has a ImageChooserBlock and a CharBlock + # Each ImageBlock has a ImageChooserBlock and a LinkWithoutLabelBlock # These should be in alphabetical order since they all have the same count block = object_list[1] self.assertEqual( @@ -246,10 +250,12 @@ def test_page_deleted(self): self.assertListEqual([campaign_page.content_type], block["content_types"]) block = object_list[3] - self.assertEqual(block["block"], "wagtail.blocks.field_block.CharBlock") + self.assertEqual( + block["block"], "networkapi.wagtailpages.pagemodels.customblocks.link_block.LinkWithoutLabelBlock" + ) self.assertEqual(block["count"], 1) - self.assertEqual(block["type_label"], "Core") - self.assertFalse(block["is_custom_block"]) + self.assertEqual(block["type_label"], "Custom") + self.assertTrue(block["is_custom_block"]) self.assertListEqual([campaign_page.content_type], block["content_types"]) block = object_list[4] diff --git a/network-api/networkapi/wagtailpages/pagemodels/customblocks/annotated_image_block.py b/network-api/networkapi/wagtailpages/pagemodels/customblocks/annotated_image_block.py index 3e40c4e6f68..9157acc50d6 100644 --- a/network-api/networkapi/wagtailpages/pagemodels/customblocks/annotated_image_block.py +++ b/network-api/networkapi/wagtailpages/pagemodels/customblocks/annotated_image_block.py @@ -2,7 +2,7 @@ from wagtail import blocks from .image_block import ImageBlock -from .link_block import LinkBlockWithoutLabel +from .link_block import LinkWithoutLabelBlock class RadioSelectBlock(blocks.ChoiceBlock): @@ -14,7 +14,7 @@ def __init__(self, *args, **kwargs): class AnnotatedImageBlock(ImageBlock): caption = blocks.CharBlock(required=False) caption_url = blocks.ListBlock( - LinkBlockWithoutLabel(), min_num=0, max_num=1, help_text="Optional URL that this caption should link out to." + LinkWithoutLabelBlock(), min_num=0, max_num=1, help_text="Optional URL that this caption should link out to." ) image_width = RadioSelectBlock( choices=( diff --git a/network-api/networkapi/wagtailpages/pagemodels/customblocks/link_block.py b/network-api/networkapi/wagtailpages/pagemodels/customblocks/link_block.py index 1e4d82c2da7..07498c77e90 100644 --- a/network-api/networkapi/wagtailpages/pagemodels/customblocks/link_block.py +++ b/network-api/networkapi/wagtailpages/pagemodels/customblocks/link_block.py @@ -68,11 +68,11 @@ class Meta: register(BaseLinkBlockAdapter(), LinkBlock) -class LinkBlockWithoutLabel(LinkBlock): +class LinkWithoutLabelBlock(LinkBlock): def __init__(self, local_blocks=None, **kwargs): super().__init__(local_blocks, **kwargs) self.child_blocks = self.base_blocks.copy() self.child_blocks.pop("label") -register(BaseLinkBlockAdapter(), LinkBlockWithoutLabel) +register(BaseLinkBlockAdapter(), LinkWithoutLabelBlock)