Skip to content

Commit 6c867c0

Browse files
committedApr 23, 2018
[oracle] Fixes for edit tests (still disabled)
1 parent 92a8089 commit 6c867c0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎tests/src/python/test_provider_oracle.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,20 @@ def tearDownClass(cls):
6060
def execSQLCommand(self, sql, ignore_errors=False):
6161
self.assertTrue(self.conn)
6262
query = QSqlQuery(self.conn)
63-
query.exec_(sql)
63+
self.assertTrue(query.exec_(sql), sql + ': ' + query.lastError().text())
6464
query.finish()
65-
if not ignore_errors:
66-
self.assertTrue(query.isValid(), sql + ': ' + query.lastError().text())
6765

6866
# disabled: WIP
6967
def disabled_getSource(self):
7068
# create temporary table for edit tests
7169
self.execSQLCommand('DROP TABLE "QGIS"."EDIT_DATA"', ignore_errors=True)
72-
self.execSQLCommand("""CREATE TABLE QGIS.EDIT_DATA ("pk" INTEGER, "cnt" INTEGER);""")
70+
self.execSQLCommand("""CREATE TABLE QGIS.EDIT_DATA ("pk" INTEGER PRIMARY KEY, "cnt" INTEGER, "name" VARCHAR2(100), "name2" VARCHAR2(100), "num_char" VARCHAR2(100), GEOM SDO_GEOMETRY)""")
7371
self.execSQLCommand("""INSERT INTO QGIS.EDIT_DATA ("pk", "cnt", "name", "name2", "num_char", GEOM)
7472
SELECT 5, -200, NULL, 'NuLl', '5', SDO_GEOMETRY( 2001,4326,SDO_POINT_TYPE(-71.123, 78.23, NULL), NULL, NULL) from dual
7573
UNION ALL SELECT 3, 300, 'Pear', 'PEaR', '3', NULL from dual
7674
UNION ALL SELECT 1, 100, 'Orange', 'oranGe', '1', SDO_GEOMETRY( 2001,4326,SDO_POINT_TYPE(-70.332, 66.33, NULL), NULL, NULL) from dual
7775
UNION ALL SELECT 2, 200, 'Apple', 'Apple', '2', SDO_GEOMETRY( 2001,4326,SDO_POINT_TYPE(-68.2, 70.8, NULL), NULL, NULL) from dual
78-
UNION ALL SELECT 4, 400, 'Honey', 'Honey', '4', SDO_GEOMETRY( 2001,4326,SDO_POINT_TYPE(-65.32, 78.3, NULL), NULL, NULL) from dual;""")
76+
UNION ALL SELECT 4, 400, 'Honey', 'Honey', '4', SDO_GEOMETRY( 2001,4326,SDO_POINT_TYPE(-65.32, 78.3, NULL), NULL, NULL) from dual""")
7977
vl = QgsVectorLayer(
8078
self.dbconn + ' sslmode=disable key=\'pk\' srid=4326 type=POINT table="QGIS"."EDIT_DATA" (GEOM) sql=',
8179
'test', 'oracle')

0 commit comments

Comments
 (0)
Please sign in to comment.