diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-10-06 11:40:54 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:11 -0300 |
commit | 676b2b579d1f9ebd4300a93fed740f1543154157 (patch) | |
tree | c45363976a3dd60a9b4de93b690fed18c4a501d4 | |
parent | f6c818b21d8aa6905e5c4fc5d5c218159ee4ba7b (diff) |
Updated QtSql modue to works with python 2.x and 3.x
-rw-r--r-- | tests/QtSql/qvarianttype_test.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/QtSql/qvarianttype_test.py b/tests/QtSql/qvarianttype_test.py index 7eae67fd8..89364e52b 100644 --- a/tests/QtSql/qvarianttype_test.py +++ b/tests/QtSql/qvarianttype_test.py @@ -1,18 +1,18 @@ '''Test cases for QVariant::Type converter''' import unittest -from PySide.QtCore import * -from PySide.QtSql import * +import py3kcompat as py3k +from PySide.QtSql import QSqlField class QVariantTypeTest(unittest.TestCase): def testQVariantType(self): - f = QSqlField("name", unicode) - self.assertEqual(f.type(), unicode) + f = QSqlField("name", str) + self.assertEqual(f.type(), py3k.unicode) f = QSqlField("name", str) - self.assertEqual(f.type(), unicode) + self.assertEqual(f.type(), py3k.unicode) f = QSqlField("name", "QString") - self.assertEqual(f.type(), unicode) + self.assertEqual(f.type(), py3k.unicode) f = QSqlField("name", "double") self.assertEqual(f.type(), float) @@ -23,8 +23,9 @@ class QVariantTypeTest(unittest.TestCase): f = QSqlField("name", int) self.assertEqual(f.type(), int) - f = QSqlField("name", long) - self.assertEqual(f.type(), int) # long isn't registered in QVariant:Type, just in QMetaType::Type + if not py3k.IS_PY3K: + f = QSqlField("name", long) + self.assertEqual(f.type(), int) # long isn't registered in QVariant:Type, just in QMetaType::Type #f = QSqlField("name", QObject) #self.assertEqual(f.type(), None) |