Пример #1
0
 def test_logout(self):
     """
         need new Client b/c using the same client can mess up other tests
         since order of tests is not guaranteed
     """
     c = Client(ag.wsgi_test_app, BaseResponse)
     login_client_with_permissions(c)
     environ, r = c.get('/users/logout',
                        as_tuple=True,
                        follow_redirects=True)
     assert r.status_code == 200, r.status
     assert BaseRequest(environ).url == 'http://localhost/users/login'
Пример #2
0
 def setup_class(cls):
     cls.c = Client(ag.wsgi_test_app, BaseResponse)
     login_client_with_permissions(cls.c, cls.perms)
Пример #3
0
 def test_unauthorized(self):
     ta = TestApp(ag.wsgi_test_app)
     login_client_with_permissions(ta)
     ta.get('/users/permissions/{0}'.format(self.userid), status=403)
Пример #4
0
 def setup_class(cls):
     cls.userid = User.testing_create().id
     cls.tam = TestApp(ag.wsgi_test_app)
     login_client_with_permissions(cls.tam, [u'auth-manage'])
Пример #5
0
 def setup_class(cls):
     cls.c = Client(ag.wsgi_test_app, BaseResponse)
     perms = [u'auth-manage', u'users-test1', u'users-test2']
     cls.userid = login_client_with_permissions(cls.c, perms)
Пример #6
0
 def setup_class(cls):
     cls.c = Client(ag.wsgi_test_app, BaseResponse)
     cls.userid = login_client_with_permissions(cls.c, u'prof-test-1',
                                                u'prof-test-2')
     cls.userid2 = create_user_with_permissions().id