Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test for uniqueValues with date/time/datetime
  • Loading branch information
nyalldawson committed May 14, 2020
1 parent d35bc0b commit 90e61ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/python/providertestbase.py
Expand Up @@ -419,6 +419,13 @@ def testUnique(self):
self.source.uniqueValues(self.source.fields().lookupField('name'))), 'Got {}'.format(
set(self.source.uniqueValues(self.source.fields().lookupField('name'))))

self.assertEqual(set(self.source.uniqueValues(self.source.fields().lookupField('dt'))),
set([QDateTime(2021, 5, 4, 13, 13, 14), QDateTime(2020, 5, 4, 12, 14, 14), QDateTime(2020, 5, 4, 12, 13, 14), QDateTime(2020, 5, 3, 12, 13, 14), NULL]))
self.assertEqual(set(self.source.uniqueValues(self.source.fields().lookupField('date'))),
set([QDate(2020, 5, 3), QDate(2020, 5, 4), QDate(2021, 5, 4), NULL]))
self.assertEqual(set(self.source.uniqueValues(self.source.fields().lookupField('time'))),
set([QTime(12, 14, 14), QTime(13, 13, 14), QTime(12, 13, 14), NULL]))

if self.source.supportsSubsetString():
subset = self.getSubsetString2()
self.source.setSubsetString(subset)
Expand Down

0 comments on commit 90e61ce

Please sign in to comment.