##// END OF EJS Templates
authn: Test authentication plugin settings POST views.
johbo -
r238:b082c123 default
parent child Browse files
Show More
@@ -42,6 +42,19 b' class TestAuthenticationSettings:'
42 42 response = app.get(url)
43 43 assert response.status_code == 200
44 44
45 def test_plugin_settings_view_post(self, app, auth_plugin, csrf_token):
46 url = '{prefix}/auth/{name}'.format(
47 prefix=ADMIN_PREFIX,
48 name=auth_plugin.name)
49 params = {
50 'enabled': True,
51 'cache_ttl': 0,
52 'csrf_token': csrf_token,
53 }
54 with EnabledAuthPlugin(auth_plugin):
55 response = app.post(url, params=params)
56 assert response.status_code in [200, 302]
57
45 58 def test_plugin_settings_view_get_404(self, app, auth_plugin):
46 59 url = '{prefix}/auth/{name}'.format(
47 60 prefix=ADMIN_PREFIX,
@@ -49,3 +62,16 b' class TestAuthenticationSettings:'
49 62 with DisabledAuthPlugin(auth_plugin):
50 63 response = app.get(url, status=404)
51 64 assert response.status_code == 404
65
66 def test_plugin_settings_view_post_404(self, app, auth_plugin, csrf_token):
67 url = '{prefix}/auth/{name}'.format(
68 prefix=ADMIN_PREFIX,
69 name=auth_plugin.name)
70 params = {
71 'enabled': True,
72 'cache_ttl': 0,
73 'csrf_token': csrf_token,
74 }
75 with DisabledAuthPlugin(auth_plugin):
76 response = app.post(url, params=params, status=404)
77 assert response.status_code == 404
General Comments 0
You need to be logged in to leave comments. Login now