Skip to content

Commit 17f20bb

Browse files
committed
PyQgsVectorFileWriter: adapt to a3f03f0
1 parent a3f03f0 commit 17f20bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/src/python/test_qgsvectorfilewriter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def testDateTimeWriteShapefile(self):
9999
#shapefiles do not support time types, result should be string
100100
self.assertEqual(fields.at(fields.indexFromName('time_f')).type(), QVariant.String)
101101
#shapefiles do not support datetime types, result should be date
102-
self.assertEqual(fields.at(fields.indexFromName('dt_f')).type(), QVariant.Date)
102+
self.assertEqual(fields.at(fields.indexFromName('dt_f')).type(), QVariant.String)
103103

104104
f = created_layer.getFeatures(QgsFeatureRequest()).next()
105105

@@ -112,8 +112,8 @@ def testDateTimeWriteShapefile(self):
112112
self.assertEqual(f.attributes()[time_idx], '13:45:22')
113113
#shapefiles do not support datetime types
114114
datetime_idx = created_layer.fieldNameIndex('dt_f')
115-
assert isinstance(f.attributes()[datetime_idx], QDate)
116-
self.assertEqual(f.attributes()[datetime_idx], QDate(2014, 3, 5))
115+
assert isinstance(f.attributes()[datetime_idx], basestring)
116+
self.assertEqual(f.attributes()[datetime_idx], QDateTime(QDate(2014, 3, 5), QTime(13, 45, 22)).toString("yyyy/MM/dd hh:mm:ss.zzz"))
117117

118118
def testDateTimeWriteTabfile(self):
119119
"""Check writing date and time fields to an MapInfo tabfile."""

0 commit comments

Comments
 (0)