Commit b811edc4 authored by Julien Cristau's avatar Julien Cristau
Browse files

[entity] comparing two entities returns NotImplemented

Fixes a test when using some versions of unittest2, where
assertItemsEqual tries a sort and expects TypeError, which it doesn't
get if we directly raise NotImplementedError.  The NotImplemented value
is treated specially by the interpreter:
parent 81fce01b4cc0
......@@ -547,7 +547,7 @@ class Entity(AppObject):
self.e_schema, self.eid, list(self.cw_attr_cache), id(self))
def __lt__(self, other):
raise NotImplementedError('comparison not implemented for %s' % self.__class__)
return NotImplemented
def __eq__(self, other):
if isinstance(self.eid, integer_types):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment