def METHOD_NAME(self):
    # here we are testing add_files_to_resource 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)
    response = add_files_to_resource(request, shortkey=self.gen_res.short_id)
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    # there should be 1 file
    self.assertEqual(self.gen_res.files.count(), 1)
    # test adding a file to a deep folder
    res_file = self.gen_res.files.first()
    hydroshare.delete_resource_file(self.gen_res.short_id, res_file.id, self.user)
    # there should be no file
    self.assertEqual(self.gen_res.files.count(), 0)
    ResourceFile.create_folder(resource=self.gen_res, folder="foo")
    post_data = {'files': (self.txt_file_name_1, open(self.txt_file_path_1), 'text/plain'),
                 'file_folder': 'foo'}
    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)
    response = add_files_to_resource(request, shortkey=self.gen_res.short_id)
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    # there should be 1 file
    self.assertEqual(self.gen_res.files.count(), 1)
    hydroshare.delete_resource(self.gen_res.short_id)