  from django.test import TestCase
  from rest_framework import serializers
  
  
  class TrackSerializer(serializers.Serializer):
      order = serializers.IntegerField()
      title = serializers.CharField(max_length=100)
      duration = serializers.IntegerField()
  
  
  class AlbumSerializer(serializers.Serializer):
      album_name = serializers.CharField(max_length=100)
      artist = serializers.CharField(max_length=100)
 
</s> remove class AlbumSerializer(serializers.Serializer):
    album_name = serializers.CharField(max_length=100)
    artist = serializers.CharField(max_length=100)
    tracks = TrackSerializer(many=True)
 </s> add         class AlbumSerializer(serializers.Serializer):
            album_name = serializers.CharField(max_length=100)
            artist = serializers.CharField(max_length=100)
            tracks = TrackSerializer(many=True) </s> remove class NestedSerializerTestCase(TestCase):
 </s> add  </s> remove         serializer = AlbumSerializer(data=data)
 </s> add         serializer = self.AlbumSerializer(data=data)
class WritableNestedSerializerBasicTests(TestCase):
    """
    Tests for deserializing nested entities.
    Basic tests that use serializers that simply restore to dicts.
    """
  from django.test import TestCase
  from rest_framework import serializers
  
  
class WritableNestedSerializerBasicTests(TestCase):
    """
    Tests for deserializing nested entities.
    Basic tests that use serializers that simply restore to dicts.
    """
class WritableNestedSerializerBasicTests(TestCase):
    """
    Tests for deserializing nested entities.
    Basic tests that use serializers that simply restore to dicts.
    """
class WritableNestedSerializerBasicTests(TestCase):
    """
    Tests for deserializing nested entities.
    Basic tests that use serializers that simply restore to dicts.
    """
class WritableNestedSerializerBasicTests(TestCase):
    """
    Tests for deserializing nested entities.
    Basic tests that use serializers that simply restore to dicts.
    """
  
  
  class AlbumSerializer(serializers.Serializer):
      album_name = serializers.CharField(max_length=100)
      artist = serializers.CharField(max_length=100)
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Extra tests for nested serializers 
rest_framework/tests/serializer_nested.py