              self.object = self.get_object()
              success_status = status.HTTP_200_OK
          except Http404:
              self.object = None
  
          serializer = self.get_serializer(data=request.DATA, instance=self.object)
  
          if serializer.is_valid():
              self.pre_save(serializer.object)
 
</s> remove             return Response(serializer.data)
 </s> add             return Response(serializer.data, status=success_status) </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)
            success_status = status.HTTP_201_CREATED
              self.object = self.get_object()
              success_status = status.HTTP_200_OK
          except Http404:
              self.object = None
            success_status = status.HTTP_201_CREATED
  
          serializer = self.get_serializer(data=request.DATA, instance=self.object)
  
          if serializer.is_valid():
              self.pre_save(serializer.object)
keep keep keep add keep keep keep keep keep
 PUT as create should return 201.  Fixes #340. 
rest_framework/mixins.py