Commit a93fc41b authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

astakos: Update tests

GET is not allowed to remove auth provider urls
parent a040e1d0
......@@ -287,12 +287,15 @@ class ShibbolethTests(TestCase):
r = client.get("/im/login/shibboleth?", follow=True)
client.reset_tokens()
# TODO: this view should use POST
r = client.get(remove_local_url)
# only POST is allowed (for CSRF protection)
r = client.get(remove_local_url, follow=True)
self.assertEqual(r.status_code, 405)
r = client.post(remove_local_url, follow=True)
# 2 providers left
self.assertEqual(user.auth_providers.count(), 1)
# cannot remove last provider
r = client.get(remove_shibbo_url)
r = client.post(remove_shibbo_url)
self.assertEqual(r.status_code, 403)
self.client.logout()
......
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