Define panel for rules to handle InlinePanel changes
This commit is contained in:
@ -6,6 +6,7 @@ import pytest
|
||||
|
||||
from tests.factories.segment import SegmentFactory
|
||||
from wagtail_personalisation.rules import TimeRule
|
||||
from wagtail_personalisation.models import Segment
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@ -25,3 +26,10 @@ def test_metadata_page_has_variants(segmented_page):
|
||||
canonical = segmented_page.personalisation_metadata.canonical_page
|
||||
assert canonical.personalisation_metadata.is_canonical
|
||||
assert canonical.personalisation_metadata.has_variants
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_segment_edit_view(site, client, django_user_model):
|
||||
test_segment = Segment()
|
||||
new_panel = test_segment.panels[1].children[0].bind_to_model(Segment)
|
||||
assert new_panel.related.name == "wagtail_personalisation_timerules"
|
||||
|
Reference in New Issue
Block a user