Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
def test_home():
    client = app.test_client()
    response = client.get("/")
    assert response.status_code == 200
Beispiel #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()
Beispiel #7
0
 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()
Beispiel #8
0
 def setUp(self):
     self.db_fd, app.config['DATABASE'] = tempfile.mkstemp()
     app.config['TESTING'] = True
     self.app = app.test_client()