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))
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)
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)
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)
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()
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)