      url(r'^upload/$', FileUploadView.as_view())
  ]
  
  
  @override_settings(ROOT_URLCONF='tests.test_request')
  class TestContentParsingWithAuthentication(TestCase):
      def setUp(self):
          self.csrf_client = APIClient(enforce_csrf_checks=True)
          self.username = 'john'
 
</s> remove         '2001-01-01T13:00Z': datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc)
 </s> add         '2001-01-01T13:00Z': datetime.datetime(2001, 1, 1, 13, 00, tzinfo=utc),
@override_settings(
    ROOT_URLCONF='tests.test_request',
    FILE_UPLOAD_HANDLERS=['django.core.files.uploadhandler.TemporaryFileUploadHandler'])
class FileUploadTests(TestCase):

    def test_fileuploads_closed_at_request_end(self):
        with tempfile.NamedTemporaryFile() as f:
            response = self.client.post('/upload/', {'file': f})

        # sanity check that file was processed
        assert len(response.data) == 1

        for file in response.data:
            assert not os.path.exists(file)


      url(r'^upload/$', FileUploadView.as_view())
  ]
  
  
@override_settings(
    ROOT_URLCONF='tests.test_request',
    FILE_UPLOAD_HANDLERS=['django.core.files.uploadhandler.TemporaryFileUploadHandler'])
class FileUploadTests(TestCase):

    def test_fileuploads_closed_at_request_end(self):
        with tempfile.NamedTemporaryFile() as f:
            response = self.client.post('/upload/', {'file': f})

        # sanity check that file was processed
        assert len(response.data) == 1

        for file in response.data:
            assert not os.path.exists(file)


  @override_settings(ROOT_URLCONF='tests.test_request')
  class TestContentParsingWithAuthentication(TestCase):
      def setUp(self):
          self.csrf_client = APIClient(enforce_csrf_checks=True)
          self.username = 'john'
keep keep keep add keep keep keep keep keep
 Ensure closables in request.FILES get closed. (#5262)

Ensure closables on `.FILES` get closed. 
tests/test_request.py