refactor and add tests
This commit is contained in:
committed by
Michael van Tellingen
parent
623af1a06a
commit
ebef7f8785
13
tests/unit/test_hooks.py
Normal file
13
tests/unit/test_hooks.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import pytest
|
||||
|
||||
from wagtail_personalisation import wagtail_hooks as hooks
|
||||
from wagtail_personalisation.models import Segment
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_check_for_variations(segmented_page):
|
||||
segments = Segment.objects.all()
|
||||
page = segmented_page.canonical_page
|
||||
|
||||
variations = hooks._check_for_variations(segments, page)
|
||||
assert variations
|
Reference in New Issue
Block a user