              self.fail('Wrong exception type thrown.')
  
  
  class CustomValidationTests(TestCase):
      class CommentSerializerWithFieldValidator(CommentSerializer):
  
          def validate_email(self, attrs, source):
 
</s> remove             kwargs = {
                'instance': obj,
                'data': value,
                'context': self.context,
                'partial': self.partial,
                'many': self.many
            }
            serializer = self.__class__(**kwargs)

            if serializer.is_valid():
                into[self.source or field_name] = serializer.object
 </s> add             if value in (None, ''):
                into[(self.source or field_name)] = None </s> remove                 # Propagate errors up to our parent
                raise NestedValidationError(serializer.errors)
 </s> add                 kwargs = {
                    'instance': obj,
                    'data': value,
                    'context': self.context,
                    'partial': self.partial,
                    'many': self.many
                }
                serializer = self.__class__(**kwargs)

                if serializer.is_valid():
                    into[self.source or field_name] = serializer.object
                else:
                    # Propagate errors up to our parent
                    raise NestedValidationError(serializer.errors) </s> remove         if value in (None, ''):
            into[(self.source or field_name)] = None
 </s> add         if self.source == '*':
            if value:
                into.update(value)
    def test_writable_star_source_on_nested_serializer(self):
        """
        Assert that a nested serializer instantiated with source='*' correctly
        expands the data into the outer serializer.
        """
        serializer = ModelSerializerWithNestedSerializer(data={
            'name': 'marko',
            'nested': {'info': 'hi'}},
        )
        self.assertEqual(serializer.is_valid(), True)

              self.fail('Wrong exception type thrown.')
  
    def test_writable_star_source_on_nested_serializer(self):
        """
        Assert that a nested serializer instantiated with source='*' correctly
        expands the data into the outer serializer.
        """
        serializer = ModelSerializerWithNestedSerializer(data={
            'name': 'marko',
            'nested': {'info': 'hi'}},
        )
        self.assertEqual(serializer.is_valid(), True)

  
  class CustomValidationTests(TestCase):
      class CommentSerializerWithFieldValidator(CommentSerializer):
  
          def validate_email(self, attrs, source):
keep add keep keep keep keep keep
 when source='*' on a nested serializer, expand fields into outer serializer when writing. fixes #765 
rest_framework/tests/serializer.py