Пример #1
0
    def setUp(self):
        """Define test variables and initialize app."""
        self.app = APP
        self.client = self.app.test_client

        # binds the app to the current context
        with self.app.app_context():
            self.db = SQLAlchemy()
            self.db.init_app(self.app)

        self.casting_assistant = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlFrXzZCV1ZMUFJLdi1LU1lDeVNJZSJ9.eyJpc3MiOiJodHRwczovL2NhcHN0b25lLTIwMjAuZXUuYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDVlYzQ1OTQzZThmODZhMGJlYWMzNDhkOCIsImF1ZCI6ImNhcHN0b25lIiwiaWF0IjoxNTkwMDA0MTIwLCJleHAiOjE1OTAwNzYxMjAsImF6cCI6IkJvc3JqM09ZblFlbHhvMFBHZ1d6Z3R5R2lBbzY2UndoIiwic2NvcGUiOiIiLCJwZXJtaXNzaW9ucyI6WyJnZXQ6YWN0b3JzIiwiZ2V0Om1vdmllcyJdfQ.EM_hvk7J2oc3yBjguyOv9PKpSY8pumAIfB0oFFGrqpRKsLZRT-PkeGU-KNEgKBahS6Z15NpwuUpdj7Jt77ci22g_E8jYdPQZQrOxctD01IWDsPAZDFnVkqAxgFyx0uAJ55U5mHWgEc7i62KiyRfc0LEMOlciILHmENmgsQeLcYp_w21o1xPu8bpVlP0WWtq40Tzc6ON1GQA94cqGS0qyV6p0kCiHnziSBvEIB7chQ65zT6roAz90Q5ur7wzanoMuwyK-7JniQ3bGtRwFLHZoImOJ8Sq56Nr-iS-aTihIGW_cFgYB46K0FvnwGo_PhgPkWCi8IpOCKhCxVuOh6qQGpw'
        self.casting_director = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlFrXzZCV1ZMUFJLdi1LU1lDeVNJZSJ9.eyJpc3MiOiJodHRwczovL2NhcHN0b25lLTIwMjAuZXUuYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDVlYzQ0ODlmMGEzYjAzMGJmOTNjZWMwMiIsImF1ZCI6ImNhcH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g6bW92aWVzIiwicG9zdDphY3RvcnMiLCJwb3N0Om1vdmllcyJdfQ.Cn6tPsXvfEr2lj4uE73gYZ4SC4c3zwh0lLH7A7q1xEdeoGYTRQndPcbSp05yjqkfMpk5JYR3V5zsKC3gRqmY4cv7MOJSeKZFrnaoPVz7awyI2qLmkUl7hs-LVO7QCPOXKq-kI8XVsMYdMl_dI9WrnRQvKsZggq2sl15cvjRynbIfP5Vc3Ox0uOMQidHZeDCYnh8OUfdi577G-NSaHsOqFariemfB3pj5fbahtoooeK3X483x-XT2KeoRkCh1ytCaJV4bsbSBPj0nxAd9rQvpvcrZDd9v3Ng9RHV43nv_DnOv9ZZC_064ExgWc--cIhi-OfQABE0CAs25w6zz6fiDeQ'
        self.new_actor = {
            "name": "Marlon Brando",
            "role": "runner",
            "gender": "male",
            "movie_id": 1
        }
        self.new_movie = {"title": "Great title", "release_year": 2019}
        self.update_movie = {
            "title": "Dance Dance Dance",
        }
        self.update_actor = {"role": "swimmer"}
        # drop and create all tables
        db.drop_all()
        db.create_all()
Пример #2
0
 def setUp(self):
     """Define test variables and initialize app."""
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['DEBUG'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = database_path
     self.app = app.test_client()
     db.drop_all()
     db.create_all()
Пример #3
0
def client():
    database_filename = 'test.db'
    project_dir = os.path.dirname(os.path.abspath(__file__))
    database_path = "sqlite:///{}".format(
        os.path.join(project_dir, database_filename))
    app.app.config['TESTING'] = True
    app.app.config['SQLALCHEMY_DATABASE_URI'] = database_path
    client = app.app.test_client()
    db.drop_all()
    db.create_all()
    yield client
Пример #4
0
 def init():
     db.create_all()
Пример #5
0
jwt = JWTManager(app)
CORS(app)

blacklist = set()

##################################### Logging settings ###############################################
log_file_path = ''
if ENV == 'local':
    log_file_path = config_options['log_file_local']
elif ENV == 'prod' or ENV == 'dev':
    log_file_path = config_options['log_file_prod']

LOG.basicConfig(
    level=LOG.INFO,
    filename=log_file_path.format(datetime.datetime.now().date()),
    format='%(asctime)s  %(levelname)-10s %(processName)s  %(name)s %(message)s'
)

##################################### DB Initialization###############################################

with app.app_context():
    db.init_app(app)
    db.create_all()

#################################### APP CONSTANTS ###################################################

#ADMIN_GROUPS = ['AHDHD'] # add another admin group from PM's when available
ADMIN_GROUPS = ['zzPDL_SKI_IGO_DATA', 'GRP_SKI_CMO_WESRecapture']
#ADMIN_GROUPS = ['GRP_SKI_CMO_WESRecapture']
CLINICAL_GROUPS = ['GRP_SKI_CMO_WESRecapture_Clinical']