8

Rename PersonalisablePageMixin.personalisable_metadata

Use PersonalisablePageMixin.personalisation_metadata instead to mirror
the package name
This commit is contained in:
Michael van Tellingen
2017-06-02 10:23:46 +02:00
parent 282baa4787
commit 5aa754dd80
5 changed files with 12 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ def site():
def segmented_page(site):
page = ContentPageFactory(parent=site.root_page, slug='personalised')
segment = SegmentFactory()
return page.personalisable_metadata.copy_for_segment(segment)
return page.personalisation_metadata.copy_for_segment(segment)
@pytest.fixture()

View File

@@ -19,9 +19,9 @@ def test_segment_create():
@pytest.mark.django_db
def test_metadata_page_has_variations(segmented_page):
assert not segmented_page.personalisable_metadata.is_canonical
assert not segmented_page.personalisable_metadata.has_variations
assert not segmented_page.personalisation_metadata.is_canonical
assert not segmented_page.personalisation_metadata.has_variations
canonical = segmented_page.personalisable_metadata.canonical_page
assert canonical.personalisable_metadata.is_canonical
assert canonical.personalisable_metadata.has_variations
canonical = segmented_page.personalisation_metadata.canonical_page
assert canonical.personalisation_metadata.is_canonical
assert canonical.personalisation_metadata.has_variations

View File

@@ -20,7 +20,7 @@ def test_serve_variation_with_variant_no_segment(site, rf, segmented_page):
args = tuple()
kwargs = {}
page = segmented_page.personalisable_metadata.canonical_page
page = segmented_page.personalisation_metadata.canonical_page
result = wagtail_hooks.serve_variation(page, request, args, kwargs)
assert result is None
@@ -31,8 +31,8 @@ def test_serve_variation_with_variant_segmented(site, rf, segmented_page):
args = tuple()
kwargs = {}
page = segmented_page.personalisable_metadata.canonical_page
segment = segmented_page.personalisable_metadata.segment
page = segmented_page.personalisation_metadata.canonical_page
segment = segmented_page.personalisation_metadata.segment
adapter = adapters.get_segment_adapter(request)
adapter.set_segments([segment])