def setUp(self): db.init_app(GoogleTest.create_app()) db.create_all() db.engine.execute('insert into model values (1, "Test Model", "google", 1, "matlab_function,1")') score = 6.5 start_date = datetime.date.today() - datetime.timedelta(days=5) for i in xrange(4): ms = ModelScore() ms.day = start_date + datetime.timedelta(days=i) ms.region = 'e' ms.value = score - i ms.model_id = 1 db.session.add(ms) gs = GoogleScore() gs.day = start_date + datetime.timedelta(days=i) gs.value = score - i gs.term_id = 1 db.session.add(gs) db.session.commit() db.engine.execute('insert into google_term values (1, "Term 1")') db.engine.execute('insert into model_google_terms values (1, 1)')
def initdb(): """Initialize the database.""" db.create_all()
def setUp(self): db.init_app(ModelsTest.create_app()) db.create_all()