  from .utils import MockObject
  
  
  # Test serializer fields imports.
  # -------------------------------
  
  class TestFieldImports:
      def is_field(self, name, value):
 
</s> remove         if not isinstance(data, dict):
 </s> add         if not isinstance(data, Mapping): </s> remove             key: value if isinstance(value, (list, dict)) else [value]
 </s> add             key: value if isinstance(value, (list, Mapping)) else [value] </s> remove     if isinstance(detail, dict):
 </s> add     if isinstance(detail, Mapping): </s> remove from collections import OrderedDict
 </s> add from collections import Mapping, OrderedDict
try:
    from collections import ChainMap
except ImportError:
    ChainMap = False

  from .utils import MockObject
  
try:
    from collections import ChainMap
except ImportError:
    ChainMap = False

  
  # Test serializer fields imports.
  # -------------------------------
  
  class TestFieldImports:
      def is_field(self, name, value):
keep add keep keep keep keep keep keep
 Check for collection.Mapping instead of dict

issue #4901 
tests/test_serializer.py