diff options
author | Juhapekka Piiroinen <juhapekka.piiroinen@gmail.com> | 2012-03-05 07:59:41 +0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2012-03-13 18:43:04 +0100 |
commit | f011ce2cb9e2b93a748874de007232ec88cc8ac1 (patch) | |
tree | 08cb7741f9d1e3691041583dd907573a33116072 /tests | |
parent | fe8dc36f90fe64590f7f13843a076f8d2d61f378 (diff) |
Bug fix for PYSIDE-7
This should resolve the issue in PYSIDE-7 "QDateTime does not support the 6-argument format".
Added function signature for 6-argument version and a testcase.
Change-Id: I617eefab6a41939c37e2f1bf800857bc2d74b6ee
Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtCore/python_conversion.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/QtCore/python_conversion.py b/tests/QtCore/python_conversion.py index 2472deed0..84845c0a8 100644 --- a/tests/QtCore/python_conversion.py +++ b/tests/QtCore/python_conversion.py @@ -43,5 +43,22 @@ class TestDateTimeConversions (unittest.TestCase): self.assertEqual(dateTime, other.toPython()) + def testQDateTime6arg(self): + dateTime = datetime.datetime(2010, 4, 23, 11, 14, 7) + other = QDateTime(dateTime) + + otherDate = other.date() + self.assertEqual(dateTime.year, otherDate.year()) + self.assertEqual(dateTime.month, otherDate.month()) + self.assertEqual(dateTime.day, otherDate.day()) + + otherTime = other.time() + self.assertEqual(dateTime.hour, otherTime.hour()) + self.assertEqual(dateTime.minute, otherTime.minute()) + self.assertEqual(dateTime.second, otherTime.second()) + self.assertEqual(dateTime.microsecond/1000, otherTime.msec()) + + self.assertEqual(dateTime, other.toPython()) + if __name__ == '__main__': unittest.main() |