def test_student_level_of_access(self): logout('localhost') user = login_user('z100', 'student228', 'localhost') self.assertEqual(has_access('localhost', Student), True) self.assertEqual(has_access('localhost', Staff), False) self.assertEqual(has_access('localhost', Admin), False)
def test_admin_level_of_access(self): logout('localhost') user = login_user('z1', 'adminPass', 'localhost') self.assertEqual(has_access('localhost', Student), True) self.assertEqual(has_access('localhost', Staff), True) self.assertEqual(has_access('localhost', Admin), True)
def logout(cls): sec.logout()
def logout_page(): return logout(request.remote_addr)
def test_student_logout(self): logout('localhost') self.assertEqual(get_user('localhost'), None) self.assertEqual(has_access('localhost', Student), False)
def test_admin_logout(self): logout('localhost') self.assertEqual(get_user('localhost'), None) self.assertEqual(has_access('localhost', Admin), False)
def logout(): return security.logout()