7

Define panel for rules to handle InlinePanel changes

This commit is contained in:
Kaitlyn Crawford
2019-01-02 16:51:56 +02:00
parent 0f9bfb0343
commit d3f4d42d82
2 changed files with 17 additions and 1 deletions

View File

@ -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"