Commit 7a706b57 authored by Łukasz Nowak's avatar Łukasz Nowak

playbook: Expose more information from the result

By allowing unittest.longMessage and adding result.content to the
test output on failure it is easier to debug issue with assertion.
parent bba0cacb
...@@ -10,6 +10,7 @@ class TestSiteHttp(unittest.TestCase): ...@@ -10,6 +10,7 @@ class TestSiteHttp(unittest.TestCase):
self.https_url = os.environ['TEST_ACCESS_URL_HTTPS'] self.https_url = os.environ['TEST_ACCESS_URL_HTTPS']
self.http_url_norm = self.http_url.replace(':10080', '') self.http_url_norm = self.http_url.replace(':10080', '')
self.https_url_norm = self.https_url.replace(':10443', '') self.https_url_norm = self.https_url.replace(':10443', '')
self.longMessage = True
def test_http_erp5_login_form(self): def test_http_erp5_login_form(self):
"""Check that accessing site over HTTP redirects to HTTPS""" """Check that accessing site over HTTP redirects to HTTPS"""
...@@ -30,7 +31,8 @@ class TestSiteHttp(unittest.TestCase): ...@@ -30,7 +31,8 @@ class TestSiteHttp(unittest.TestCase):
is_permanent_redirect=False, is_permanent_redirect=False,
status_code=302, status_code=302,
location=self.https_url_norm + '/erp5/login_form' location=self.https_url_norm + '/erp5/login_form'
) ),
result.content
) )
def test_http_erp5_anydomain(self): def test_http_erp5_anydomain(self):
...@@ -53,5 +55,6 @@ class TestSiteHttp(unittest.TestCase): ...@@ -53,5 +55,6 @@ class TestSiteHttp(unittest.TestCase):
is_permanent_redirect=False, is_permanent_redirect=False,
status_code=302, status_code=302,
location='https://anyhost/erp5/' location='https://anyhost/erp5/'
) ),
result.content
) )
\ No newline at end of file
...@@ -8,6 +8,7 @@ class TestSiteHttps(unittest.TestCase): ...@@ -8,6 +8,7 @@ class TestSiteHttps(unittest.TestCase):
def setUp(self): def setUp(self):
self.https_url = os.environ['TEST_ACCESS_URL_HTTPS'] self.https_url = os.environ['TEST_ACCESS_URL_HTTPS']
self.https_url_norm = self.https_url.replace(':10443', '') self.https_url_norm = self.https_url.replace(':10443', '')
self.longMessage = True
def test_https_erp5_login_form(self): def test_https_erp5_login_form(self):
"""Check that accessing login_form over HTTPS works""" """Check that accessing login_form over HTTPS works"""
...@@ -24,7 +25,8 @@ class TestSiteHttps(unittest.TestCase): ...@@ -24,7 +25,8 @@ class TestSiteHttps(unittest.TestCase):
is_redirect=False, is_redirect=False,
is_permanent_redirect=False, is_permanent_redirect=False,
status_code=200 status_code=200
) ),
result.content
) )
self.assertTrue('ERP5 Free Open Source ERP and CRM' in result.text) self.assertTrue('ERP5 Free Open Source ERP and CRM' in result.text)
...@@ -46,7 +48,8 @@ class TestSiteHttps(unittest.TestCase): ...@@ -46,7 +48,8 @@ class TestSiteHttps(unittest.TestCase):
is_permanent_redirect=False, is_permanent_redirect=False,
status_code=302, status_code=302,
location=self.https_url_norm + '/erp5/login_form' location=self.https_url_norm + '/erp5/login_form'
) ),
result.content
) )
@unittest.skip( @unittest.skip(
...@@ -72,5 +75,6 @@ class TestSiteHttps(unittest.TestCase): ...@@ -72,5 +75,6 @@ class TestSiteHttps(unittest.TestCase):
is_permanent_redirect=False, is_permanent_redirect=False,
status_code=302, status_code=302,
location='https://anyhost/erp5/login_form' location='https://anyhost/erp5/login_form'
) ),
result.content
) )
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment