コード例 #1
0
 def test_single_auth_method(self):
     # Remove the second auth method
     self.app.config['SRP_AUTH_METHODS'].pop()
     evesrp.init_app(self.app)
     # Test
     resp = self.app.test_client().get('/login', follow_redirects=True)
     self.assertIn('Null Auth 1', resp.get_data(as_text=True))
     self.assertNotIn('Null Auth 2', resp.get_data(as_text=True))
コード例 #2
0
ファイル: test_divisions.py プロジェクト: boweiliu/evesrp
 def setUp(self):
     super(TestDivisionDetails, self).setUp()
     with self.app.test_request_context():
         db.session.add(Division("Test Division"))
         db.session.add(Group("Group 1", self.default_authmethod.name, id=10))
         db.session.commit()
     self.app.config["SRP_SHIP_TYPE_URL_TRANSFORMERS"] = [("Test Transformer", "")]
     evesrp.init_app(self.app)
コード例 #3
0
ファイル: test_divisions.py プロジェクト: J4LP/evesrp
 def setUp(self):
     super(TestDivisionDetails, self).setUp()
     with self.app.test_request_context():
         db.session.add(Division('Test Division'))
         db.session.add(Group('Group 1', self.default_authmethod.name,
                 id=10))
         db.session.commit()
     self.app.config['SRP_SHIP_TYPE_URL_TRANSFORMERS'] = [
         ('Test Transformer', ''),
     ]
     evesrp.init_app(self.app)
コード例 #4
0
 def setUp(self):
     super(TestDivisionDetails, self).setUp()
     with self.app.test_request_context():
         db.session.add(Division('Test Division'))
         db.session.add(
             Group('Group 1', self.default_authmethod.name, id=10))
         db.session.commit()
     self.app.config['SRP_SHIP_TYPE_URL_TRANSFORMERS'] = [
         ('Test Transformer', ''),
     ]
     evesrp.init_app(self.app)
コード例 #5
0
ファイル: util_tests.py プロジェクト: BlueNexus/evesrp
 def setUp(self):
     super(TestLogin, self).setUp()
     self.auth_methods = [
             NullAuth(name='Null Auth 1'),
             NullAuth(name='Null Auth 2'),
     ]
     self.app.config['SRP_AUTH_METHODS'] = self.auth_methods
     init_app(self.app)
     self.normal_name = 'Normal User'
     self.admin_name = 'Admin User'
     self.default_authmethod = self.auth_methods[0]
     with self.app.test_request_context():
         db.session.add(User(self.normal_name,
             self.default_authmethod.name))
         admin_user = User(self.admin_name, self.default_authmethod.name)
         admin_user.admin = True
         db.session.add(admin_user)
         db.session.commit()
コード例 #6
0
 def setUp(self):
     super(TestLogin, self).setUp()
     self.auth_methods = [
         NullAuth(name='Null Auth 1'),
         NullAuth(name='Null Auth 2'),
     ]
     self.app.config['SRP_AUTH_METHODS'] = self.auth_methods
     init_app(self.app)
     self.normal_name = 'Normal User'
     self.admin_name = 'Admin User'
     self.default_authmethod = self.auth_methods[0]
     with self.app.test_request_context():
         db.session.add(User(self.normal_name,
                             self.default_authmethod.name))
         admin_user = User(self.admin_name, self.default_authmethod.name)
         admin_user.admin = True
         db.session.add(admin_user)
         db.session.commit()
コード例 #7
0
 def test_hashes_enabled(self):
     self.app.config['SRP_STATIC_FILE_HASH'] = True
     init_app(self.app)
     index_resp = self.client.get('/')
     self._test_static_files(index_resp)
コード例 #8
0
 def test_hashes_enabled(self):
     self.app.config['SRP_STATIC_FILE_HASH'] = True
     init_app(self.app)
     index_resp = self.client.get('/')
     self._test_static_files(index_resp)