diff options
author | Roald de Vries <rdevries@thoughtworks.com> | 2016-12-07 15:26:10 +0100 |
---|---|---|
committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-12-07 15:26:10 +0100 |
commit | d10f607a4d40587510b0dc31b31fe4750bf4a3a3 (patch) | |
tree | db016bb0878989249e0f329e2162d11067b0f8b7 /service/test/unit/resources/test_login_resource.py | |
parent | c28abba2f5b1186c671ebef508d40ffaae6d5bc5 (diff) | |
parent | eaf2019b6e977d1191e0ee12f694a02bb9612f83 (diff) |
[#801] Merge branch 'signup'
Diffstat (limited to 'service/test/unit/resources/test_login_resource.py')
-rw-r--r-- | service/test/unit/resources/test_login_resource.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/service/test/unit/resources/test_login_resource.py b/service/test/unit/resources/test_login_resource.py index 45036f8d..1161acc4 100644 --- a/service/test/unit/resources/test_login_resource.py +++ b/service/test/unit/resources/test_login_resource.py @@ -157,6 +157,19 @@ class TestLoginResource(unittest.TestCase): d.addCallback(assert_default_invalid_banner_disclaimer_rendered) return d + def test_form_should_contain_csrftoken_input(self): + request = DummyRequest(['']) + + d = self.web.get(request) + + def assert_form_has_csrftoken_input(_): + input_username = 'name="csrftoken"' + written_response = ''.join(request.written) + self.assertIn(input_username, written_response) + + d.addCallback(assert_form_has_csrftoken_input) + return d + class TestLoginPOST(unittest.TestCase): def setUp(self): @@ -222,7 +235,7 @@ class TestLoginPOST(unittest.TestCase): def assert_interstitial_in_response(_): mock_authenticate.assert_called_once_with(self.username, self.password) - interstitial_js_in_template = '<script src="startup-assets/Interstitial.js"></script>' + interstitial_js_in_template = '<script src="static/Interstitial.js"></script>' self.assertIn(interstitial_js_in_template, self.request.written[0]) d.addCallback(assert_interstitial_in_response) |