Exemple #1
0
 def setUp(self):
     self.app = create_app(testing=True)
     self.app_context = self.app.app_context()
     self.app_context.push()
     db.create_all()
     # Create a test user
     usr = Users(email='*****@*****.**', username='******')
     usr.set_password('testpass')
     db.session.add(usr)
     db.session.commit()
     self.user = usr
    def setUp(self):
        self.app = create_app(testing=True)
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.create_all()
        self.client = self.app.test_client()
        self.baseURL = '/api/v1'

        # Create a test user
        usr = Users(email='*****@*****.**', username='******')
        usr.set_password('testpass')
        db.session.add(usr)
        db.session.commit()
        self.user = usr

        # Setup a bearer token
        with self.app_context:
            self.token = create_access_token(self.user.id)
Exemple #3
0
 def setUp(self):
     self.app = create_app(testing=True)
     self.app_context = self.app.app_context()
     self.app_context.push()
     db.create_all()
     self.client = self.app.test_client()
Exemple #4
0
from contacts.app import create_app

application = create_app()