コード例 #1
0
    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='*****@*****.**')
コード例 #2
0
    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='*****@*****.**')
コード例 #3
0
 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
     })
コード例 #4
0
    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()
コード例 #5
0
 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})