Message347961
Maybe I am missing something, but while it is true that DjangoModel is doing the wrong thing by returning False instead of NotImplemented, the `ANY` sentinel is supposed to match *anything*, not just things that compare equal to it, right? I would expect this to work, for example:
class EqualsNothing:
def __eq__(self, other):
return False
m = Mock(spec_set=EqualsNothing)
obj = EqualsNothing()
m(obj)
m.assert_has_calls([call(ANY)])
In that example, it is deliberate that EqualsNothing returns False for any type, but ANY should still match it. I think maybe the solution here is to special-case the matching with ANY so the criterion for a call matching would be `y is ANY or x == y`. |
|
Date |
User |
Action |
Args |
2019-07-15 14:20:09 | p-ganssle | set | recipients:
+ p-ganssle, serhiy.storchaka, xtreak, ElizabethU |
2019-07-15 14:20:09 | p-ganssle | set | messageid: <1563200409.62.0.480955192044.issue37555@roundup.psfhosted.org> |
2019-07-15 14:20:09 | p-ganssle | link | issue37555 messages |
2019-07-15 14:20:09 | p-ganssle | create | |
|