Skip to content

Commit cceada3

Browse files
author
Michael Howitz
committed
Fix comparison for classes implementing __eq__.
There are currently only two new failing tests: * Comparing an object with a proxy of the object fails (but comparing the proxy with the object is fine!) * Comparing a proxy with itself fails But these tests run fine when deleting the `__eq__` method on the `Something` class which is the class of `self.x`.
1 parent 8468570 commit cceada3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/zope/security/tests/test_proxy.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,9 +1808,15 @@ def testCallOK(self):
18081808
def testCallFail(self):
18091809
self.shouldFail(self.p, None)
18101810

1811-
def testRichCompareOK(self):
1811+
def testRichCompareProxyWithObjectOK(self):
18121812
self.assertTrue(self.p == self.x)
18131813

1814+
def testRichCompareObjectWithProxyOK(self):
1815+
self.assertTrue(self.x == self.p)
1816+
1817+
def testRichCompareWithProxyWithProxyOK(self):
1818+
self.assertTrue(self.p == self.p)
1819+
18141820
## def testRichCompareFail(self):
18151821
## self.shouldFail(lambda: self.p == self.x)
18161822

0 commit comments

Comments
 (0)