Commit c0e4479d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

check if key authentication works for non front page and web mode.

# this test fails for now.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43785 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9987f24a
......@@ -51,7 +51,7 @@ class TestUserManagement(ERP5TypeTestCase):
def getBusinessTemplateList(self):
"""List of BT to install. """
return ('erp5_base',)
return ('erp5_base', 'erp5_web',)
def beforeTearDown(self):
"""Clears person module and invalidate caches when tests are finished."""
......@@ -721,6 +721,28 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self.assertEqual(response.getStatus(), 200)
self.assertTrue(reference in response.getBody())
# check if key authentication works other page than front page
person_module = portal.person_module
base_url = person_module.absolute_url(relative=1)
response = self.publish(base_url)
self.assertEqual(response.getStatus(), 302)
self.assertTrue('location' in response.headers.keys())
self.assertTrue('%s/login_form?came_from=' % portal.getId(), response.headers['location'])
response = self.publish('%s?__ac_key=%s' %(base_url, key))
self.assertEqual(response.getStatus(), 200)
self.assertTrue(reference in response.getBody())
# check if key authentication works with web_mode too
web_site = portal.web_site_module.newContent(portal_type='Web Site')
base_url = web_site.absolute_url(relative=1)
response = self.publish(base_url)
self.assertEqual(response.getStatus(), 302)
self.assertTrue('location' in response.headers.keys())
self.assertTrue('%s/login_form?came_from=' % portal.getId(), response.headers['location'])
response = self.publish('%s?__ac_key=%s' %(base_url, key))
self.assertEqual(response.getStatus(), 200)
self.assertTrue(reference in response.getBody())
def testERP5ExternalAuthenticationPlugin(self):
"""
Make sure that we can grant security using a ERP5 External Authentication Plugin.
......
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