# HG changeset patch # User Julien Cristau # Date 1456388901 -3600 # Node ID e7514e949ad8f82022fac11cd0b18c61ccac9e98 # Parent 81fce01b4cc00a314e4198005bf34f5f90579a9f [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 diff -r 81fce01b4cc0 -r e7514e949ad8 cubicweb/entity.py --- 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):