PySide/tests/QtGui/bug_569.py
Hugo Parente Lima 7810dcd829 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>
2010-12-29 10:14:28 -02:00

19 lines
474 B
Python

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()