Exemple #1
0
    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())
Exemple #2
0
    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())
Exemple #3
0
    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())
Exemple #4
0
    def test_logout_anon(self):
        from ptahcrowd import login

        request = self.make_request()
        res = login.logout(request)
        self.assertIsInstance(res, HTTPFound)
Exemple #5
0
    def test_logout_anon(self):
        from ptahcrowd import login

        request = self.make_request()
        res = login.logout(request)
        self.assertIsInstance(res, HTTPFound)