def setUp(self):
     self.app = create_app()
     self.app_context = self.app.app_context()
     self.app_context.push()
     self.bcrypt = Bcrypt(self.app)
     db.create_all()
     self.test_user = User(
         'Will Smith', '*****@*****.**',
         self.bcrypt.generate_password_hash('testing123_$%').decode(
             'utf-8'))
     db.session.add(self.test_user)
     db.session.commit()
     self.test_client = Client("Company X", '*****@*****.**',
                               'bio text goes here, bio text goes here', 1,
                               '7176577957', self.test_user.id)
     db.session.add(self.test_client)
     db.session.commit()
     self.test_product = Product('Product-A', 'Product Desciption',
                                 self.test_client.id)
     db.session.add(self.test_product)
     db.session.commit()
     pa1 = ProductArea('Area1', self.test_product.id)
     pa2 = ProductArea('Area2', self.test_product.id)
     db.session.add(pa1)
     db.session.add(pa2)
     db.session.commit()
示例#2
0
 def setUp(self):
     self.app = create_app()
     self.app_context = self.app.app_context()
     self.app_context.push()
     self.bcrypt = Bcrypt(self.app)
     db.create_all()
     self.test_user = User('Will Smith', '*****@*****.**',
                           self.bcrypt.generate_password_hash('testing123_$%').decode('utf-8'))
     db.session.add(self.test_user)
     db.session.commit()
示例#3
0
from feature_lab import create_app, db

app = create_app()

app.app_context().push()

db.create_all()
示例#4
0
 def setUp(self):
     self.app = create_app()
     self.app_context = self.app.app_context()
     self.app_context.push()
     db.create_all()