Exemple #1
0
from datetime import datetime
from feature_lab import create_app, db
from flask_bcrypt import Bcrypt
from feature_lab.models import User, Client, Product, ProductArea, FeatureRequest

app = create_app()
app.app_context().push()
bcrypt = Bcrypt(app)

db.drop_all()
db.create_all()

# create a user
user = User('Rafat Assaf', '*****@*****.**',
            bcrypt.generate_password_hash('Testing123$'))

db.session.add(user)
db.session.commit()

# create clients
client_1 = Client('Kings Landing solutions', '*****@*****.**',
                  'Technical solutions across all of Westeros', '92387471989',
                  user.id)
client_2 = Client('Winterfell solutions', '*****@*****.**',
                  'Technical solutions across all of the world', '74897928191',
                  user.id)

db.session.add(client_1)
db.session.add(client_2)
db.session.commit()
Exemple #2
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
     self.app_context.pop()