コード例 #1
0
 def test_no_username_reset_page_with_key(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ[
         'PATH_INFO'] = '/user/reset/ebe0c59e-5d27-4331-8a7c-17ead7ac7f38?key=d1d7a7df0a'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #2
0
 def test_with_api_key(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['HTTP_X_CKAN_API_KEY'] = 'aaaa'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #3
0
 def test_no_username_reset_page_with_key(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['PATH_INFO'] = '/user/reset/ebe0c59e-5d27-4331-8a7c-17ead7ac7f38?key=d1d7a7df0a'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #4
0
 def test_no_username_reset_page(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['PATH_INFO'] = '/user/reset'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #5
0
 def test_with_username(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['REMOTE_USER'] = '******'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #6
0
 def test_no_username(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     check = middleware.checkUser(os.environ)
     assert check == False
コード例 #7
0
 def test_with_api_key(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['HTTP_X_CKAN_API_KEY'] = 'aaaa'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #8
0
 def test_no_username_reset_page(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['PATH_INFO'] = '/user/reset'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #9
0
 def test_with_username(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     os.environ['REMOTE_USER'] = '******'
     check = middleware.checkUser(os.environ)
     assert check == True
コード例 #10
0
 def test_no_username(self):
     self.app = paste.fixture.TestApp(pylons.test.pylonsapp)
     middleware = DCAuthMiddleware(self.app)
     check = middleware.checkUser(os.environ)
     assert check == False