def setUp(self): self.app = create_app('TESTING_CONFIG') self.app_context = self.app.app_context() self.app_context.push() from sqlalchemy.orm.mapper import configure_mappers configure_mappers() db.create_all() test_username = '******' test_password = '******' Organization.insert_org() User.insert_user(username=test_username, password=test_password, email='*****@*****.**') OperatorEventType.insert_operator_event_types() self.client = self.app.test_client(use_cookies=False) UserScope.insert_scopes() admin = User.query.filter_by(user_name='admin').first() scope = UserScope.query.filter_by(scope_name='asset_manager').first() admin.scopes.append(scope) db.session.add(admin) db.session.commit() joe = User.insert_user(username='******', password='******', email='*****@*****.**') bob = User.insert_user(username='******', password='******', email='*****@*****.**')
def setUp(self): self.app = create_app('TESTING_CONFIG') self.app_context = self.app.app_context() self.app_context.push() from sqlalchemy.orm.mapper import configure_mappers configure_mappers() db.create_all() test_username = '******' test_password = '******' Organization.insert_org() User.insert_user(username=test_username, password=test_password, email='*****@*****.**') OperatorEventType.insert_operator_event_types() self.client = self.app.test_client(use_cookies=False) UserScope.insert_scopes() admin = User.query.filter_by(user_name='admin').first() scope = UserScope.query.filter_by(scope_name='user_admin').first() admin.scopes.append(scope) db.session.add(admin) db.session.commit() joe = User.insert_user(username='******', password='******', email='*****@*****.**') bob = User.insert_user(username='******', password='******', email='*****@*****.**')
def test_operator_event_type(self): #Test the json in the object operator_event_type = OperatorEventType() self.assertTrue(operator_event_type.to_json() == { 'id': None, 'type_name': None, 'type_description': None })
def setUp(self): self.app = create_app('TESTING_CONFIG') self.app_context = self.app.app_context() self.app_context.push() db.create_all() test_username = '******' test_password = '******' User.insert_user(username=test_username, password=test_password) OperatorEventType.insert_operator_event_types() self.client = self.app.test_client(use_cookies=False) UserScope.insert_scopes() admin = User.query.filter_by(user_name='admin').first() scope = UserScope.query.filter_by(scope_name='user_admin').first() admin.scopes.append(scope) db.session.add(admin) db.session.commit()
def test_operator_event_type(self): #Test the json in the object operator_event_type = OperatorEventType() self.assertTrue(operator_event_type.to_json() == {'id': None, 'type_name': None, 'type_description': None})