Commit f072f74e authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Alain Takoudjou

Easy debugging.

Show sorted list, as sorting does not impact sets equality, and, if possible,
format a list in human readable way.
parent 6df99cda
......@@ -521,7 +521,14 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
genbt5list=1)
def assertSameSet(self, a, b, msg=None):
self.assertSetEqual(set(a), set(b), msg)
if not msg:
try:
from pprint import pformat
except ImportError:
msg='%r != %r' % (sorted(a), sorted(b))
else:
msg='\n%s\n!=\n%s' % (pformat(sorted(a)), pformat(sorted(b)))
self.assertEqual(set(a), set(b), msg)
failIfDifferentSet = assertSameSet
def assertHasAttribute(self, obj, attribute, msg=None):
......
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