Skip to content
Permalink
Browse files

Fix PG connections API test

  • Loading branch information
elpaso authored and nyalldawson committed Feb 8, 2021
1 parent def8f3a commit 1ce050359b5005b60a0c3b887d0c2d64a8f76531
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/src/python/test_qgsproviderconnection_postgres.py
@@ -216,10 +216,10 @@ def test_postgis_raster_rename(self):
md.saveConnection(conn, 'qgis_test1')

table = self._table_by_name(conn.tables('qgis_test', QgsAbstractDatabaseProviderConnection.Raster), 'Raster1')
self.assertTrue(QgsRasterLayer("PG: %s schema='qgis_test' column='%s' table='%s'" % (conn.uri(), table.geometryColumn(), table.tableName()), 'r1', 'gdal').isValid())
self.assertTrue(QgsRasterLayer("PG: %s dbname='qgis_test' schema='qgis_test' column='%s' table='%s'" % (conn.uri(), table.geometryColumn(), table.tableName()), 'r1', 'gdal').isValid())
conn.renameRasterTable('qgis_test', table.tableName(), 'Raster2')
table = self._table_by_name(conn.tables('qgis_test', QgsAbstractDatabaseProviderConnection.Raster), 'Raster2')
self.assertTrue(QgsRasterLayer("PG: %s schema='qgis_test' column='%s' table='%s'" % (conn.uri(), table.geometryColumn(), table.tableName()), 'r1', 'gdal').isValid())
self.assertTrue(QgsRasterLayer("PG: %s dbname='qgis_test' schema='qgis_test' column='%s' table='%s'" % (conn.uri(), table.geometryColumn(), table.tableName()), 'r1', 'gdal').isValid())
table_names = self._table_names(conn.tables('qgis_test', QgsAbstractDatabaseProviderConnection.Raster))
self.assertFalse('Raster1' in table_names)
self.assertTrue('Raster2' in table_names)

0 comments on commit 1ce0503

Please sign in to comment.