Use service=qgis_test for referencing test database

Makes PostgreSQL testing setup consistent.
Updates README accordingly
This commit is contained in:
Sandro Santilli 2019-11-14 09:27:44 +01:00
parent cbe6150348
commit 46a05727e8
2 changed files with 2 additions and 3 deletions

View File

@ -57,9 +57,8 @@ To test the postgres provider you will need to have a database available to
which the postgres provider can connect. The server will need to have PostGIS which the postgres provider can connect. The server will need to have PostGIS
support enabled. support enabled.
By default the test uses one of the following connection string: By default the tests use the following connection string:
dbname=qgis_test
service=qgis_test service=qgis_test
If these do not match your setup you can set the environment variable If these do not match your setup you can set the environment variable

View File

@ -39,7 +39,7 @@ class TestPyQgsProviderConnectionPostgres(unittest.TestCase, TestPyQgsProviderCo
def setUpClass(cls): def setUpClass(cls):
"""Run before all tests""" """Run before all tests"""
TestPyQgsProviderConnectionBase.setUpClass() TestPyQgsProviderConnectionBase.setUpClass()
cls.postgres_conn = 'dbname=\'qgis_test\'' cls.postgres_conn = "service='qgis_test'"
if 'QGIS_PGTEST_DB' in os.environ: if 'QGIS_PGTEST_DB' in os.environ:
cls.postgres_conn = os.environ['QGIS_PGTEST_DB'] cls.postgres_conn = os.environ['QGIS_PGTEST_DB']
# Create test layers # Create test layers