  
  
  class BulkUpdateSerializerTests(TestCase):
  
      def setUp(self):
          class Book(object):
              """
              A data type that can be persisted to a mock storage backend
              with `.save()` and `.delete()`.
 
</s> remove         Correct bulk update serialization should return the input data.
 </s> add         Incorrect bulk update serialization should return error data. </s> remove                 for item in data:
                    if update:
                        # Determine which object we're updating
                        try:
                            identity = self.get_identity(item)
                        except:
                            self.object = None
                        else:
                            self.object = identity_to_objects.pop(identity, None)
 </s> add                 try:
                    iter(data)
                    if isinstance(data, dict):
                        raise TypeError
                except TypeError:
                    self._errors = {'non_field_errors': ['Expected a list of items']}
                else:
                    for item in data:
                        if update:
                            # Determine which object we're updating
                            try:
                                identity = self.get_identity(item)
                            except:
                                self.object = None
                            else:
                                self.object = identity_to_objects.pop(identity, None)

                        ret.append(self.from_native(item, None))
                        errors.append(self._errors)
    """
    Updating multiple instances using serializers.
    """
  
  
  class BulkUpdateSerializerTests(TestCase):
    """
    Updating multiple instances using serializers.
    """
  
      def setUp(self):
          class Book(object):
              """
              A data type that can be persisted to a mock storage backend
              with `.save()` and `.delete()`.
keep keep add keep keep keep keep keep keep
 Add extra tests for errors from incorrect data with multiple create/update 
rest_framework/tests/serializer_bulk_update.py