Skip to content
Permalink
Browse files

PyQgsVectorFileWriter: adapt to a3f03f0

  • Loading branch information
jef-n committed Feb 25, 2016
1 parent a3f03f0 commit 17f20bbb3647a18e170224f7a506c35edd4ff4d3
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/src/python/test_qgsvectorfilewriter.py
@@ -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

Contributor

@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()

@@ -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."""

0 comments on commit 17f20bb

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