summaryrefslogtreecommitdiff
path: root/service/test/unit/resources/test_login_resource.py
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-02-22 17:49:27 +0100
committerNavaL <ayoyo@thoughtworks.com>2016-02-22 17:49:27 +0100
commit7c1affe11f7563911c34c9d439fe5ed1bf7c3a17 (patch)
treeae5f96f7c7b642276fe3d1462369633e81141c08 /service/test/unit/resources/test_login_resource.py
parent82d4432b977e0960746bba1c6f03077fb6322263 (diff)
Removes stacktrace errors from appearing on the login page.
For the case of wrong file path or file not existing Issue #214
Diffstat (limited to 'service/test/unit/resources/test_login_resource.py')
-rw-r--r--service/test/unit/resources/test_login_resource.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/service/test/unit/resources/test_login_resource.py b/service/test/unit/resources/test_login_resource.py
index d8194156..4076946a 100644
--- a/service/test/unit/resources/test_login_resource.py
+++ b/service/test/unit/resources/test_login_resource.py
@@ -122,6 +122,23 @@ class TestLoginResource(unittest.TestCase):
d.addCallback(tear_down)
return d
+ def test_wrong_banner_file_location_will_send_default_invalid_format_banner(self):
+ request = DummyRequest([''])
+
+ non_existing_banner_file = 'banner.txt'
+
+ self.resource._disclaimer_banner = non_existing_banner_file
+
+ d = self.web.get(request)
+
+ def assert_default_invalid_banner_disclaimer_rendered(_):
+ self.assertEqual(200, request.responseCode)
+ written_response = ''.join(request.written)
+ self.assertIn("Disclaimer banner file banner.txt could not be read or does not exit.", written_response)
+
+ d.addCallback(assert_default_invalid_banner_disclaimer_rendered)
+ return d
+
class TestLoginPOST(unittest.TestCase):
def setUp(self):