Don't require datadiff on tests
@@ -167,5 +167,10 @@ class APIEndpointMixin(TestCase):
It's just a helper for debugging API responses.
"""
+ message = ''
+ try:
import datadiff
- return super().assertDictEqual(d1, d2, datadiff.diff(d1, d2))
+ message = datadiff.diff(d1, d2)
+ except ImportError:
+ pass
+ return super().assertDictEqual(d1, d2, message)
