If we call self.assertEqual(dict(), serializer.errors), TestCase.assertEqual will not dispatch to assertDictEqual because type(serializer.errors) is not dict and it falls back to the generic equality assertion function. This is what produces unusable error messages that are highly truncated.
An alternative would be to subclass django.TestCase and override _getAssertEqualityFunc to special case the dict wrapper returned by DRF.
┆Issue is synchronized with this Jira Task
If we call
self.assertEqual(dict(), serializer.errors),TestCase.assertEqualwill not dispatch toassertDictEqualbecausetype(serializer.errors) is not dictand it falls back to the generic equality assertion function. This is what produces unusable error messages that are highly truncated.An alternative would be to subclass
django.TestCaseand override_getAssertEqualityFuncto special case the dict wrapper returned by DRF.┆Issue is synchronized with this Jira Task