Skip to content

Commit 3da3dea

Browse files
committedMay 14, 2020
Attempt to fix Oracle datetime addition
1 parent 9165b1c commit 3da3dea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎tests/src/python/providertestbase.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,16 @@ def testAddFeatureFastInsert(self):
642642
f1 = QgsFeature()
643643
f1.setAttributes(
644644
[6, -220, NULL, 'String', '15',
645-
'2019-01-02 03:04:05' if self.treat_datetime_as_string() else QDateTime(2019, 1, 2, 3, 4, 5), '2019-01-02' if self.treat_date_as_string() else QDateTime(2019, 1, 2, 0, 0, 0) if self.treat_date_as_datetime() else QDate(2019, 1, 2),
645+
'2019-01-02 03:04:05' if self.treat_datetime_as_string() else QDateTime(2019, 1, 2, 3, 4, 5),
646+
'2019-01-02' if self.treat_date_as_string() else QDateTime(2019, 1, 2, 0, 0, 0) if self.treat_date_as_datetime() else QDate(2019, 1, 2),
646647
'03:04:05' if self.treat_time_as_string() else QTime(3, 4, 5)])
647648
f1.setGeometry(QgsGeometry.fromWkt('Point (-72.345 71.987)'))
648649

649650
f2 = QgsFeature()
650-
f2.setAttributes([7, 330, 'Coconut', 'CoCoNut', '13', NULL, NULL, NULL])
651+
f2.setAttributes([7, 330, 'Coconut', 'CoCoNut', '13',
652+
'2019-01-02 03:04:05' if self.treat_datetime_as_string() else QDateTime(2019, 1, 2, 3, 4, 5),
653+
'2019-01-02' if self.treat_date_as_string() else QDateTime(2019, 1, 2, 0, 0, 0) if self.treat_date_as_datetime() else QDate(2019, 1, 2),
654+
'03:04:05' if self.treat_time_as_string() else QTime(3, 4, 5)])
651655

652656
if l.dataProvider().capabilities() & QgsVectorDataProvider.AddFeatures:
653657
# expect success

0 commit comments

Comments
 (0)
Please sign in to comment.