Fix bug#569 - "QTableWidgetItem is missing binding of __lt__ to operator<"

Reviewer: Renato Araújo <renato.filho@openbossa.org>
          Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
Hugo Parente Lima 2010-12-28 18:53:06 -02:00
commit 7810dcd829
3 changed files with 20 additions and 15 deletions

View file

@ -23,6 +23,7 @@ PYSIDE_TEST(bug_512.py)
PYSIDE_TEST(bug_525.py)
PYSIDE_TEST(bug_547.py)
PYSIDE_TEST(bug_549.py)
PYSIDE_TEST(bug_569.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)

19
tests/QtGui/bug_569.py Normal file
View file

@ -0,0 +1,19 @@
from PySide.QtCore import *
from PySide.QtGui import *
import unittest
class TestBug569(unittest.TestCase):
def testIt(self):
types = (QTableWidgetItem, QListWidgetItem, QTreeWidgetItem)
for t in types:
a = t()
a.__lt__ = lambda(other) : True
b = t()
b.__lt__ = lambda(other) : False
self.assertTrue(a < b)
self.assertFalse(b < a)
if __name__ == '__main__':
unittest.main()