def METHOD_NAME(self):
    # here we are testing delete_file view function
    # There should be no files for the resource now
    self.assertEqual(self.gen_res.files.count(), 0)
    # add a file
    post_data = {'files': (self.txt_file_name_1, open(self.txt_file_path_1), 'text/plain')}
    url_params = {'shortkey': self.gen_res.short_id}
    url = reverse('add_files_to_resource', kwargs=url_params)
    request = self.factory.post(url, data=post_data)
    request.user = self.user
    # make it a ajax request
    request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
    self.set_request_message_attributes(request)
    self.add_session_to_request(request)
    add_files_to_resource(request, shortkey=self.gen_res.short_id)
    res_file = self.gen_res.files.first()
    # test the delete_file view function
    url_params = {'shortkey': self.gen_res.short_id, 'f': res_file.id}
    url = reverse('delete_file', kwargs=url_params)
    request = self.factory.post(url, data={})
    request.user = self.user
    request.META['HTTP_REFERER'] = 'some-url'
    self.set_request_message_attributes(request)
    self.add_session_to_request(request)
    response = delete_file(request, shortkey=self.gen_res.short_id, f=res_file.id)
    self.assertEqual(response.status_code, status.HTTP_302_FOUND)
    self.assertEqual(response['Location'], request.META['HTTP_REFERER'])
    self.assertEqual(self.gen_res.files.count(), 0)
    hydroshare.delete_resource(self.gen_res.short_id)