7

Wagtail 3 changes

This commit is contained in:
Alex Bridge
2022-01-28 11:53:57 +00:00
committed by nick.moreton
parent dd4530203f
commit c7eaec1315
89 changed files with 3003 additions and 1456 deletions

View File

@ -2,6 +2,7 @@ import datetime
import pytest
from django.db.models import ProtectedError
from wagtail import VERSION as WAGTAIL_VERSION
from tests.factories.page import ContentPageFactory
from tests.factories.segment import SegmentFactory
@ -16,7 +17,8 @@ def test_segment_create():
TimeRule(
start_time=datetime.time(8, 0, 0),
end_time=datetime.time(23, 0, 0),
segment=segment)
segment=segment,
)
@pytest.mark.django_db
@ -76,8 +78,8 @@ def test_sitemap_generation_for_variants_is_disabled(segmented_page):
@pytest.mark.django_db
def test_segment_edit_view(site, client, django_user_model):
test_segment = SegmentFactory()
try:
new_panel = test_segment.panels[1].children[0].bind_to(model=Segment)
except AttributeError:
if WAGTAIL_VERSION >= (3, 0):
new_panel = test_segment.panels[1].children[0].bind_to_model(Segment)
else:
new_panel = test_segment.panels[1].children[0].bind_to(model=Segment)
assert new_panel.related.name == "wagtail_personalisation_timerules"