Пример #1
0
 def setUp(self):
     app.config.from_object('config')
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://'
     self.app = app.test_client(use_cookies=False)
     with app.app_context():
         db.create_all()
     self._create_roles()
Пример #2
0
    def setUp(self):
        """ Uses an in memory sqlite database for testing """
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://'
        db.init_app(app)
        with app.app_context():
            db.create_all()

        db.session.add(Role(role_type='admin'))
        db.session.add(Role(role_type='teacher'))
        db.session.add(Role(role_type='student'))
        db.session.commit()
Пример #3
0
 def setUp(self):
     """ Uses an in memory sqlite database for testing """
     app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://"
     db.init_app(app)
     with app.app_context():
         db.create_all()
Пример #4
0
 def tearDown(self):
     """ Ensures that the database is emptied for next unit test """
     app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://"
     db.init_app(app)
     with app.app_context():
         db.drop_all()
Пример #5
0
 def tearDown(self):
     """ Ensures that the database is emptied for next unit test """
     with app.app_context():
         db.drop_all()