Skip to content

Commit

Permalink
Fix failing mssql provider test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 16, 2016
1 parent a0aba98 commit 5c3c99c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/src/python/providertestbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [field.name() for field in self.provider.fields() if field.name() != 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
continue
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):
Expand Down

0 comments on commit 5c3c99c

Please sign in to comment.