Fix failing tests

This commit is contained in:
Nyall Dawson 2017-05-02 11:44:50 +10:00
parent 348c886602
commit f81971daa4
2 changed files with 4 additions and 3 deletions

View File

@ -478,7 +478,7 @@ def createVectorWriter(destination, encoding, fields, geometryType, crs, context
layer = QgsVectorLayer(uri, destination, 'memory')
sink = layer.dataProvider()
context.temporaryLayerStore().addMapLayer(layer, False)
context.temporaryLayerStore().addMapLayer(layer)
destination = layer.id()
elif destination.startswith(POSTGIS_LAYER_PREFIX):
uri = QgsDataSourceUri(destination[len(POSTGIS_LAYER_PREFIX):])
@ -515,7 +515,7 @@ def createVectorWriter(destination, encoding, fields, geometryType, crs, context
layer = QgsVectorLayer(uri.uri(), uri.table(), "postgres")
sink = layer.dataProvider()
context.temporaryLayerStore().addMapLayer(layer, False)
context.temporaryLayerStore().addMapLayer(layer)
elif destination.startswith(SPATIALITE_LAYER_PREFIX):
uri = QgsDataSourceUri(destination[len(SPATIALITE_LAYER_PREFIX):])
try:
@ -545,7 +545,7 @@ def createVectorWriter(destination, encoding, fields, geometryType, crs, context
layer = QgsVectorLayer(uri.uri(), uri.table(), "spatialite")
sink = layer.dataProvider()
context.temporaryLayerStore().addMapLayer(layer, False)
context.temporaryLayerStore().addMapLayer(layer)
else:
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
OGRCodes = {}

View File

@ -684,5 +684,6 @@ class TestQgsProject(unittest.TestCase):
p = None
self.assertTrue(l1.isValid())
if __name__ == '__main__':
unittest.main()