Skip to content
Browse files
Fix failing mssql provider test
  • Loading branch information
nyalldawson committed Mar 16, 2016
1 parent a0aba98 commit 5c3c99cb3cc8d26aeb9265c68ec3bd5cd42eed43
Showing with 4 additions and 1 deletion.
  1. +4 −1 tests/src/python/
@@ -397,12 +397,15 @@ def testGetFeaturesSubsetAttributes(self):
self.assertEqual(result, expected, 'Expected {}, got {}'.format(expected, result))

def testGetFeaturesSubsetAttributes2(self):
""" Test that other fields are NULL wen fetching subsets of attributes """
""" Test that other fields are NULL when fetching subsets of attributes """

for field_to_fetch in ['pk', 'cnt', 'name', 'name2']:
for f in self.provider.getFeatures(QgsFeatureRequest().setSubsetOfAttributes([field_to_fetch], self.provider.fields())):
# Check that all other fields are NULL
for other_field in [ for field in self.provider.fields() if != field_to_fetch]:
if other_field == 'pk':
# skip checking the primary key field, as it may be validly fetched by providers to use as feature id
self.assertEqual(f[other_field], NULL, 'Value for field "{}" was present when it should not have been fetched by request'.format(other_field))

def testGetFeaturesNoGeometry(self):

0 comments on commit 5c3c99c

Please sign in to comment.