summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-10-06 11:40:54 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-10-06 15:43:32 -0300
commit98508492aa9b3e9ee1d6e700427a8ab81fd6ea24 (patch)
tree3c8dfbb83ec26946596c75cccb9ea1dc13e33b1a /tests
parent30b0b91afc7b5eb0a778f94a53e46326ac1361cd (diff)
downloadpyside-98508492aa9b3e9ee1d6e700427a8ab81fd6ea24.tar.gz
pyside-98508492aa9b3e9ee1d6e700427a8ab81fd6ea24.tar.xz
pyside-98508492aa9b3e9ee1d6e700427a8ab81fd6ea24.zip
Updated QtSql modue to works with python 2.x and 3.x
Diffstat (limited to 'tests')
-rw-r--r--tests/QtSql/qvarianttype_test.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/QtSql/qvarianttype_test.py b/tests/QtSql/qvarianttype_test.py
index 7eae67f..89364e5 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)