Skip to content
Permalink
Browse files

make code compatible with QGIS 2.x

  • Loading branch information
3nids committed Feb 11, 2018
1 parent 1f051ff commit 42dd971368087b7acb6d4ac364eee21d7fe6b6ed
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/src/python/test_qgspostgresdomain.py
@@ -16,7 +16,7 @@

import os

from qgis.core import QgsVectorLayer, QgsProject
from qgis.core import QgsVectorLayer, QgsMapLayerRegistry

from qgis.testing import start_app, unittest

@@ -37,7 +37,7 @@ def setUpClass(cls):
# Create test layer
cls.vl = QgsVectorLayer(cls.dbconn + ' sslmode=disable key=\'pk\' table="qgis_test"."colors" sql=', 'colors', 'postgres')

QgsProject.instance().addMapLayer(cls.vl)
QgsMapLayerRegistry.instance().addMapLayer(cls.vl, True)

def test_postgres_domain(self):
self.assertEqual(self.vl.dataProvider().enumValues(1), ['red', 'green', 'blue'])

0 comments on commit 42dd971

Please sign in to comment.
You can’t perform that action at this time.