Commit ad0b2fa8 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Rafael Monnerat

Easy debugging.

Show sorted list, as sorting does not impact sets equality, and, if possible,
format a list in human readable way.
parent 6d9cbf06
......@@ -547,8 +547,13 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
def failIfDifferentSet(self, a, b, msg=""):
if not msg:
msg='%r != %r' % (a, b)
self.assertEqual(set(a), set(b), 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.assertEquals(set(a), set(b), msg)
assertSameSet = failIfDifferentSet
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