[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:
https://docs.python.org/3.4/library/constants.html#NotImplemented
--- a/cubicweb/entity.py Thu Feb 18 09:24:43 2016 +0100
+++ b/cubicweb/entity.py Thu Feb 25 09:28:21 2016 +0100
@@ -547,7 +547,7 @@
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):