  import pytest
  from django.db import models
  
  from rest_framework import exceptions, fields, relations, serializers
  from rest_framework.compat import Mapping
  from rest_framework.fields import Field
  
  from .models import (
      ForeignKeyTarget, NestedForeignKeySource, NullableForeignKeySource
  )
 
</s> remove from rest_framework.compat import Mapping, postgres_fields
 </s> add from rest_framework.compat import postgres_fields </s> remove from rest_framework.compat import MutableMapping, coreapi
 </s> add from rest_framework.compat import coreapi
  import pytest
  from django.db import models
  
  from rest_framework import exceptions, fields, relations, serializers

  from rest_framework.fields import Field
  
  from .models import (
      ForeignKeyTarget, NestedForeignKeySource, NullableForeignKeySource
  )
keep keep keep keep replace keep keep keep keep keep
 Remove unnecessary compatibility shims from rest_framework/compat.py (#6631)

For Python 3, collections.abc.Mapping and collections.abc.MutableMapping
are always available from the stdlib. 
tests/test_serializer.py