  
          if serializer.is_valid():
              self.pre_save(serializer.object)
              self.object = serializer.save()
              return Response(serializer.data)
  
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
      def pre_save(self, obj):
          """
 
</s> remove         self.assertEquals(response.status_code, status.HTTP_200_OK)
 </s> add         self.assertEquals(response.status_code, status.HTTP_201_CREATED) </s> remove         self.assertEquals(response.status_code, status.HTTP_200_OK)
 </s> add         self.assertEquals(response.status_code, status.HTTP_201_CREATED) </s> remove         self.assertEquals(response.status_code, status.HTTP_200_OK)
 </s> add         self.assertEquals(response.status_code, status.HTTP_201_CREATED)
            return Response(serializer.data, status=success_status)
  
          if serializer.is_valid():
              self.pre_save(serializer.object)
              self.object = serializer.save()
            return Response(serializer.data, status=success_status)
  
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  
      def pre_save(self, obj):
          """
keep keep keep keep replace keep keep keep keep keep
 PUT as create should return 201.  Fixes #340. 
rest_framework/mixins.py