Support Wagtail 4.2 (#1)
Co-authored-by: nick.moreton <nick.moreton@torchbox.com> Co-authored-by: Nick Moreton <nick.moreton@torchbox.com> Reviewed-on: #1
This commit is contained in:
@ -9,11 +9,12 @@ from tests.factories.segment import SegmentFactory
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_time_rule_create():
|
||||
segment = SegmentFactory(name='TimeSegment')
|
||||
segment = SegmentFactory(name="TimeSegment")
|
||||
time_rule = TimeRuleFactory(
|
||||
start_time=datetime.time(8, 0, 0),
|
||||
end_time=datetime.time(23, 0, 0),
|
||||
segment=segment)
|
||||
segment=segment,
|
||||
)
|
||||
|
||||
assert time_rule.start_time == datetime.time(8, 0, 0)
|
||||
|
||||
@ -21,13 +22,14 @@ def test_time_rule_create():
|
||||
@pytest.mark.django_db
|
||||
@freeze_time("10:00:00")
|
||||
def test_requesttime_segment(client, site):
|
||||
time_only_segment = SegmentFactory(name='Time only')
|
||||
time_only_segment = SegmentFactory(name="Time only")
|
||||
TimeRuleFactory(
|
||||
start_time=datetime.time(8, 0, 0),
|
||||
end_time=datetime.time(23, 0, 0),
|
||||
segment=time_only_segment)
|
||||
segment=time_only_segment,
|
||||
)
|
||||
|
||||
response = client.get('/')
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
|
||||
assert client.session['segments'][0]['encoded_name'] == 'time-only'
|
||||
assert client.session["segments"][0]["encoded_name"] == "time-only"
|
||||
|
Reference in New Issue
Block a user