def setUp(self): app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'test.db') self.app = app.test_client() db.create_all() u = User('John', 'Smith', 'Vista', 'Admin', '*****@*****.**', 'test') db.session.add(u) db.session.commit()
def setUp(self): app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'test.db') self.app = app.test_client() db.create_all() u = User('John', 'Smith', 'Vista', 'Admin', '*****@*****.**', 'test') r1 = Record(user_id='1', training_name='Safety Overview', date_time=datetime.strptime('2015-01-01', due_date_format)) r2 = Record(user_id='1', training_name='Hazard Communication', date_time=datetime.strptime('2014-06-15', due_date_format)) r3 = Record(user_id='1', training_name='Controlled Chemical Substances', date_time=datetime.strptime('2014-01-01', due_date_format)) db.session.add(u) db.session.add(r1) db.session.add(r2) db.session.add(r3) db.session.commit() print "\n" print "*~" * 20