Skip to content
Permalink
Browse files

Test for uniqueValues with date/time/datetime

  • Loading branch information
nyalldawson committed May 13, 2020
1 parent d35bc0b commit 90e61cef6dfd56157aa474a70616e1700eb51784
Showing with 7 additions and 0 deletions.
  1. +7 −0 tests/src/python/providertestbase.py
@@ -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)

0 comments on commit 90e61ce

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