Skip to content
Permalink
Browse files

Attempt to fix Oracle datetime addition

  • Loading branch information
nyalldawson committed May 14, 2020
1 parent 9165b1c commit 3da3deafc0e6e62dde225cccfa4f29ad12b4b98e
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/src/python/providertestbase.py
@@ -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

0 comments on commit 3da3dea

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