Exemplo n.º 1
0
    def setUp(self):

        app.config['TESTING'] = True
        app.config[
            'SQLALCHEMY_DATABASE_URI'] = 'sqlite:////' + self.TESTS_DB_PATH
        self.app = app.test_client()
        db.create_all()
Exemplo n.º 2
0
 def setUp(self):
     app.config['Testing'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['DEBUG'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
         "DB_STRING",
         'postgres://*****:*****@/postgres?host=35.226.209.166')
     self.app = app.test_client()
Exemplo n.º 3
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['DEBUG'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.abspath('test.db')
     self.app = app.test_client()
     app.register_blueprint(animal_api)
     db.drop_all()
     db.create_all()
Exemplo n.º 4
0
 def setUp(self):
     """
     Creates a new database for the unit test to use
     """
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['DEBUG'] = True
     app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
     self.client = app.test_client()
     self.ctx = app.app_context()
     self.app = app
     db.init_app(self.app)
     with self.app.app_context():
         db.create_all()
Exemplo n.º 5
0
def test_home():
    client = app.test_client()
    response = client.get("/")
    assert response.status_code == 200
Exemplo n.º 6
0
 def setUp(self):
     path_to_db = os.environ.get('UNISPORT_TEST_DB_PATH')
     app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///" + path_to_db
     app.config['TESTING'] = True
     self.app = app.test_client()
Exemplo n.º 7
0
Arquivo: tests.py Projeto: emzatos/idb
 def setUp(self):
     # Flask apps testing. See: http://flask.pocoo.org/docs/testing/
     app.config['TESTING'] = True
     app.config['CSRF_ENABLED'] = False
     self.app = app.test_client()
Exemplo n.º 8
0
 def setUp(self):
     self.db_fd, app.config['DATABASE'] = tempfile.mkstemp()
     app.config['TESTING'] = True
     self.app = app.test_client()