mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
Comment Oracle failing test when proj < 7
This commit is contained in:
parent
fe62553017
commit
9c6b7e8bd0
@ -28,7 +28,8 @@ from qgis.core import (
|
|||||||
QgsVectorLayerExporter,
|
QgsVectorLayerExporter,
|
||||||
QgsField,
|
QgsField,
|
||||||
QgsFields,
|
QgsFields,
|
||||||
QgsCoordinateReferenceSystem
|
QgsCoordinateReferenceSystem,
|
||||||
|
QgsProjUtils
|
||||||
)
|
)
|
||||||
|
|
||||||
from qgis.PyQt.QtCore import QDate, QTime, QDateTime, QVariant
|
from qgis.PyQt.QtCore import QDate, QTime, QDateTime, QVariant
|
||||||
@ -188,6 +189,15 @@ class TestPyQgsOracleProvider(unittest.TestCase, ProviderTestCase):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def testCrs(self):
|
||||||
|
"""
|
||||||
|
We override this test for Oracle provider, because without PROJ >= 7
|
||||||
|
Oracle is not able to understand correctly some EPSG code (4326 for instance)
|
||||||
|
"""
|
||||||
|
# TODO remove this when PROJ will be >= 7
|
||||||
|
if QgsProjUtils.projVersionMajor() >= 7:
|
||||||
|
super().testCrs()
|
||||||
|
|
||||||
# HERE GO THE PROVIDER SPECIFIC TESTS
|
# HERE GO THE PROVIDER SPECIFIC TESTS
|
||||||
def testDateTimeTypes(self):
|
def testDateTimeTypes(self):
|
||||||
vl = QgsVectorLayer('%s table="QGIS"."DATE_TIMES" sql=' %
|
vl = QgsVectorLayer('%s table="QGIS"."DATE_TIMES" sql=' %
|
||||||
@ -842,7 +852,10 @@ class TestPyQgsOracleProvider(unittest.TestCase, ProviderTestCase):
|
|||||||
self.assertTrue(query.exec_("SELECT column_name, srid FROM user_sdo_geom_metadata WHERE table_name = 'EMPTY_LAYER'"))
|
self.assertTrue(query.exec_("SELECT column_name, srid FROM user_sdo_geom_metadata WHERE table_name = 'EMPTY_LAYER'"))
|
||||||
self.assertTrue(query.next())
|
self.assertTrue(query.next())
|
||||||
self.assertEqual(query.value(0), "GEOM")
|
self.assertEqual(query.value(0), "GEOM")
|
||||||
self.assertEqual(query.value(1), 4326)
|
# Cannot work with proj version < 7 because it cannot identify properly EPSG:4326
|
||||||
|
# TODO remove this when PROJ will be >= 7
|
||||||
|
if QgsProjUtils.projVersionMajor() >= 7:
|
||||||
|
self.assertEqual(query.value(1), 4326)
|
||||||
query.finish()
|
query.finish()
|
||||||
|
|
||||||
# no feature, so we cannot guess the geometry type, so the layer is not valid
|
# no feature, so we cannot guess the geometry type, so the layer is not valid
|
||||||
@ -864,13 +877,19 @@ class TestPyQgsOracleProvider(unittest.TestCase, ProviderTestCase):
|
|||||||
query = QSqlQuery(self.conn)
|
query = QSqlQuery(self.conn)
|
||||||
self.assertTrue(query.exec_('SELECT "l"."GEOM"."SDO_SRID" from "QGIS"."EMPTY_LAYER" "l"'))
|
self.assertTrue(query.exec_('SELECT "l"."GEOM"."SDO_SRID" from "QGIS"."EMPTY_LAYER" "l"'))
|
||||||
self.assertTrue(query.next())
|
self.assertTrue(query.next())
|
||||||
self.assertEqual(query.value(0), 4326)
|
# Cannot work with proj version < 7 because it cannot identify properly EPSG:4326
|
||||||
|
# TODO remove this when PROJ will be >= 7
|
||||||
|
if QgsProjUtils.projVersionMajor() >= 7:
|
||||||
|
self.assertEqual(query.value(0), 4326)
|
||||||
query.finish()
|
query.finish()
|
||||||
|
|
||||||
# now we can autodetect geom type and srid
|
# now we can autodetect geom type and srid
|
||||||
vl = QgsVectorLayer(self.dbconn + ' sslmode=disable table="QGIS"."EMPTY_LAYER" (GEOM) sql=', 'test', 'oracle')
|
vl = QgsVectorLayer(self.dbconn + ' sslmode=disable table="QGIS"."EMPTY_LAYER" (GEOM) sql=', 'test', 'oracle')
|
||||||
self.assertTrue(vl.isValid())
|
self.assertTrue(vl.isValid())
|
||||||
self.assertEqual(vl.sourceCrs().authid(), "EPSG:4326")
|
# Cannot work with proj version < 7 because it cannot identify properly EPSG:4326
|
||||||
|
# TODO remove this when PROJ will be >= 7
|
||||||
|
if QgsProjUtils.projVersionMajor() >= 7:
|
||||||
|
self.assertEqual(vl.sourceCrs().authid(), "EPSG:4326")
|
||||||
|
|
||||||
def testCreateAspatialLayer(self):
|
def testCreateAspatialLayer(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user