def METHOD_NAME(self):
    # delete a file first
    seafile_api.del_file(self.repo_id, '/',
                         json.dumps([self.file_name]),
                         self.user_name)
    self.login_as(self.user)
    # get commit id form trash
    trash_url = reverse('api-v2.1-repo-trash', args=[self.repo_id])
    trash_resp = self.client.get(trash_url)
    self.assertEqual(200, trash_resp.status_code)
    trash_json_resp = json.loads(trash_resp.content)
    assert trash_json_resp['data'][0]['obj_name'] == self.file_name
    assert not trash_json_resp['data'][0]['is_dir']
    assert trash_json_resp['data'][0]['commit_id']
    commit_id = trash_json_resp['data'][0]['commit_id']
    dir_url = reverse('api-v2.1-dir-view', args=[self.repo_id])
    url = reverse('api-v2.1-repo-commit-revert', args=[self.repo_id, commit_id])
    # test can post
    resp = self.client.get(dir_url)
    self.assertEqual(200, resp.status_code)
    json_resp = json.loads(resp.content)
    assert len(json_resp['dirent_list']) == 1
    resp = self.client.post(url)
    self.assertEqual(200, resp.status_code)
    resp = self.client.get(dir_url)
    self.assertEqual(200, resp.status_code)
    json_resp = json.loads(resp.content)
    assert len(json_resp['dirent_list']) == 2
    # test_can_not_post_with_invalid_repo_permission
    self.logout()
    self.login_as(self.admin)
    resp = self.client.post(url)
    self.assertEqual(403, resp.status_code)