--- a/web/test/unittest_web.py Thu Mar 13 17:03:15 2014 +0100
+++ b/web/test/unittest_web.py Tue Apr 08 16:12:39 2014 +0200
@@ -102,6 +102,18 @@
webreq = self.web_request(headers=headers)
self.assertIn('lang="en"', webreq.read())
+ def test_response_codes(self):
+ with self.admin_access.client_cnx() as cnx:
+ admin_eid = cnx.user.eid
+ # guest can't see admin
+ webreq = self.web_request('/%d' % admin_eid)
+ self.assertEqual(webreq.status, 403)
+
+ # but admin can
+ self.web_login()
+ webreq = self.web_request('/%d' % admin_eid)
+ self.assertEqual(webreq.status, 200)
+
if __name__ == '__main__':
unittest_main()