def getTotalFats(): app = create_app(True) app.app_context().push() db.drop_all() db.create_all() passwordHash = bcrypt.generate_password_hash("TestPassword").decode( 'utf-8') user = User(username="******", email="*****@*****.**", password_hash=passwordHash) meal1 = Meal(food="Test Food One", servings=1, calories=100, protein=1, carbs=3, fats=5, owner=user) meal2 = Meal(food="Test Food Two", servings=2, calories=33, protein=2, carbs=4, fats=6, owner=user) db.session.add(meal1) db.session.add(meal2) db.session.commit()
def addTest(): app = create_app(True) app.app_context().push() db.drop_all() db.create_all() passwordHash = bcrypt.generate_password_hash("TestPassword").decode( 'utf-8') user = User(username="******", email="*****@*****.**", password_hash=passwordHash) db.session.add(user) db.session.commit()
def delete(): app = create_app(True) app.app_context().push() db.drop_all() db.create_all()
def addTUser(): app = create_app(True) app.app_context().push() db.drop_all() db.create_all()
from cloze import create_app app = create_app(False) if __name__ == '__main__': app.run(debug=True)