Skip to content

Commit

Permalink
Attempt to fix Oracle datetime addition
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 14, 2020
1 parent 9165b1c commit 3da3dea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/src/python/providertestbase.py
Expand Up @@ -642,12 +642,16 @@ def testAddFeatureFastInsert(self):
f1 = QgsFeature()
f1.setAttributes(
[6, -220, NULL, 'String', '15',
'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),
'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),
'03:04:05' if self.treat_time_as_string() else QTime(3, 4, 5)])
f1.setGeometry(QgsGeometry.fromWkt('Point (-72.345 71.987)'))

f2 = QgsFeature()
f2.setAttributes([7, 330, 'Coconut', 'CoCoNut', '13', NULL, NULL, NULL])
f2.setAttributes([7, 330, 'Coconut', 'CoCoNut', '13',
'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),
'03:04:05' if self.treat_time_as_string() else QTime(3, 4, 5)])

if l.dataProvider().capabilities() & QgsVectorDataProvider.AddFeatures:
# expect success
Expand Down

0 comments on commit 3da3dea

Please sign in to comment.