Module: check_mk
Branch: master
Commit: 595c263747a1ce63e8a22676eea99cdc05ce1b3f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=595c263747a1ce…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Jan 4 08:50:14 2019 +0100
Adapted test case for base path redirection.
The previous state was really confusing: We redirect via FOUND (302), but
due to a bug this status code was rendered as "301 Moved Permanently". The
fix is to keep redirecting via the FOUND status code (which is the same
default as werkzeug/flask) and fix the test case instead. This is supported
by WebSession.check_redirect(), too.
Anyway, we should have a closer look at this at some point...
Change-Id: I2ab2301953c788aa7fcdb94627b4f761c3dda5f4
---
tests/integration/omd/test_web_access.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/integration/omd/test_web_access.py b/tests/integration/omd/test_web_access.py
index 06d8cd4..b518047 100644
--- a/tests/integration/omd/test_web_access.py
+++ b/tests/integration/omd/test_web_access.py
@@ -29,12 +29,13 @@ def test_base_path_redirects(site):
def test_cmk_base_path_access(site):
web = CMKWebSession(site)
+ # TODO: Figure out if which status code we *really* expect here: 301 or 302?
web.check_redirect("/%s/check_mk/" % site.id,
- expected_code=301,
+ expected_code=302,
expected_target="/%s/check_mk/login.py?_origtarget=index.py" % site.id)
web.check_redirect("/%s/check_mk/index.py" % site.id,
- expected_code=301,
+ expected_code=302,
expected_target="/%s/check_mk/login.py?_origtarget=index.py" % site.id)