Skip to content

Commit

Permalink
PyQgsVectorFileWriter: adapt to a3f03f0
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 25, 2016
1 parent a3f03f0 commit 17f20bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/python/test_qgsvectorfilewriter.py
Expand Up @@ -99,7 +99,7 @@ def testDateTimeWriteShapefile(self):
#shapefiles do not support time types, result should be string
self.assertEqual(fields.at(fields.indexFromName('time_f')).type(), QVariant.String)
#shapefiles do not support datetime types, result should be date
self.assertEqual(fields.at(fields.indexFromName('dt_f')).type(), QVariant.Date)
self.assertEqual(fields.at(fields.indexFromName('dt_f')).type(), QVariant.String)

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Feb 25, 2016

Collaborator

@jef-n r comment above should probably be fixed too

This comment has been minimized.

Copy link
@jef-n

jef-n Feb 26, 2016

Author Member

fixed in 76fcb1f


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

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

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

0 comments on commit 17f20bb

Please sign in to comment.