def test_logout(self): from ptahcrowd import login from ptahcrowd.provider import CrowdUser user = CrowdUser(name="name", login="******", email="email", password="******") CrowdUser.__type__.add(user) uri = user.__uri__ request = DummyRequest() request.environ["HTTP_HOST"] = "example.com" ptah.auth_service.set_userid(uri) res = login.logout(request) self.assertIsInstance(res, HTTPFound) self.assertIsNone(ptah.auth_service.get_userid())
def test_logout(self): from ptahcrowd import login from ptahcrowd.provider import CrowdUser user = CrowdUser(username='******', email='email', password='******') CrowdUser.__type__.add(user) uri = user.__uri__ request = self.make_request() request.environ['HTTP_HOST'] = 'example.com' ptah.auth_service.set_userid(uri) res = login.logout(request) self.assertIsInstance(res, HTTPFound) self.assertIsNone(ptah.auth_service.get_userid())
def test_logout_anon(self): from ptahcrowd import login request = self.make_request() res = login.logout(request) self.assertIsInstance(res, HTTPFound)