SQLAlchemy 1.4 requires SQLALCHEMY_DATABASE_URI to use postgresql rather than postgres for the connection uri to the database.

When deploying to paas the database postgres environment variables are set using VCAP_SERVICES provided by PaaS. When we start up the app and set the properties we need to replace the postgres string with postgresql for the app to start up properly.
This wasn't caught locally or with the unit tests because we were setting this property with postgresql.
This commit is contained in:
Rebecca Law
2021-04-29 13:49:37 +01:00
parent 424796bdcc
commit 590f29b28a
2 changed files with 3 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ def cloudfoundry_environ(os_environ, cloudfoundry_config):
def test_extract_cloudfoundry_config_populates_other_vars(cloudfoundry_environ):
extract_cloudfoundry_config()
assert os.environ['SQLALCHEMY_DATABASE_URI'] == 'postgres uri'
assert os.environ['SQLALCHEMY_DATABASE_URI'] == 'postgresql uri'
assert os.environ['NOTIFY_ENVIRONMENT'] == '🚀🌌'
assert os.environ['NOTIFY_LOG_PATH'] == '/home/vcap/logs/app.log'