Skip to content

Commit 024cb9a

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 4605759 commit 024cb9a

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
@@ -1860,9 +1860,15 @@ def testCallOK(self):
18601860
def testCallFail(self):
18611861
self.shouldFail(self.p, None)
18621862

1863-
def testRichCompareOK(self):
1863+
def testRichCompareProxyWithObjectOK(self):
18641864
self.assertTrue(self.p == self.x)
18651865

1866+
def testRichCompareObjectWithProxyOK(self):
1867+
self.assertTrue(self.x == self.p)
1868+
1869+
def testRichCompareWithProxyWithProxyOK(self):
1870+
self.assertTrue(self.p == self.p)
1871+
18661872
## def testRichCompareFail(self):
18671873
## self.shouldFail(lambda: self.p == self.x)
18681874

0 commit comments

Comments
 (0)