          self.factory = RequestFactory()
  
      def test_upload_file(self):
  
          class FileForm(forms.Form):
              file = forms.FileField()
  
          class MockView(View):
              permissions = ()
              form = FileForm
  
 
</s> remove         class MockView(View):
            permissions = ()
            form = FileForm
 </s> add #         class FileForm(forms.Form):
#             file = forms.FileField() </s> remove     def test_upload_file(self):
 </s> add # class UploadFilesTests(TestCase):
#     """Check uploading of files"""
#     def setUp(self):
#         self.factory = RequestFactory() </s> remove             def post(self, request, *args, **kwargs):
                return Response({'FILE_NAME': self.CONTENT['file'].name,
                        'FILE_CONTENT': self.CONTENT['file'].read()})
 </s> add #         class MockView(View):
#             permissions = ()
#             form = FileForm </s> remove class UploadFilesTests(TestCase):
    """Check uploading of files"""
    def setUp(self):
        self.factory = RequestFactory()
 </s> add  </s> remove         class MockView(View):
            resource = MockResource
 </s> add #     def test_disabled_form_validator_returns_content_unchanged(self):
#         """If the view's form attribute is None then FormValidator(view).validate_request(content, None)
#         should just return the content unmodified."""
#         class DisabledFormResource(FormResource):
#             form = None

#         class MockView(View):
#             resource = DisabledFormResource
#     def test_upload_file(self):
          self.factory = RequestFactory()
  
      def test_upload_file(self):
  
#     def test_upload_file(self):
#     def test_upload_file(self):
  
          class MockView(View):
              permissions = ()
              form = FileForm
  
keep keep keep keep replace replace keep keep keep keep keep
 Drop out resources & mixins 
djangorestframework/tests/files.py