From 46f0a937b5660cae84674cee8ba59dd0881b3f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 14 Jul 2018 11:59:06 +0200 Subject: [PATCH] tests: only check path of URL --- tests/test_public.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_public.py b/tests/test_public.py index 1a57fd5d..595145bb 100644 --- a/tests/test_public.py +++ b/tests/test_public.py @@ -602,28 +602,28 @@ def test_redirects(app): redirect = Redirect(old_url='/whatever/', page=page3) redirect.save() - assert app.get('/whatever/', status=301).location == '/second/third/' - assert app.get('/whatever', status=301).location == '/whatever/' + assert urlparse(app.get('/whatever/', status=301).location).path == '/second/third/' + assert urlparse(app.get('/whatever', status=301).location).path == '/whatever/' # check the most recent redirect is called redirect = Redirect(old_url='/whatever/', page=page2) redirect.save() - assert app.get('/whatever/', status=301).location == '/second/' + assert urlparse(app.get('/whatever/', status=301).location).path == '/second/' # rename page page3.slug = 'third2' page3.save() assert app.get('/second/third2/', status=200) - assert app.get('/second/third/', status=301).location == '/second/third2/' + assert urlparse(app.get('/second/third/', status=301).location).path == '/second/third2/' page2.slug = 'second2' page2.save() - assert app.get('/second/third/', status=301).location == '/second2/third2/' - assert app.get('/second/third2/', status=301).location == '/second2/third2/' - assert app.get('/second/', status=301).location == '/second2/' + assert urlparse(app.get('/second/third/', status=301).location).path == '/second2/third2/' + assert urlparse(app.get('/second/third2/', status=301).location).path == '/second2/third2/' + assert urlparse(app.get('/second/', status=301).location).path == '/second2/' # change parent page3.parent = None page3.save() - assert app.get('/second/third/', status=301).location == '/third2/' - assert app.get('/second2/third2/', status=301).location == '/third2/' + assert urlparse(app.get('/second/third/', status=301).location).path == '/third2/' + assert urlparse(app.get('/second2/third2/', status=301).location).path == '/third2/'