Fix bug#633 - "bool of null QDate (possibly other empty QString/null QObj types?) returns True for empty instance; probably should be False"

This commit is contained in:
Hugo Parente Lima 2011-01-24 15:20:53 -02:00
commit 286f9c6d09
2 changed files with 6 additions and 1 deletions

View file

@ -23,6 +23,11 @@ class TestQDate (unittest.TestCase):
self.assertEqual(week, 52)
self.assertEqual(yearNumber, 1999)
def testBooleanCast(self):
today = QDate.currentDate()
self.assertTrue(today)
nodate = QDate()
self.assertFalse(nodate)
if __name__ == '__main__':
unittest.main()