1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

fix test case

This commit is contained in:
王健辉
2019-05-24 13:52:33 +08:00
parent a6896917e8
commit 9c3c94993b
3 changed files with 5 additions and 5 deletions

View File

@@ -134,7 +134,7 @@ class AdminLibraryTest(BaseTestCase):
self.login_as(self.admin)
data = 'status=%s' % 1
data = 'status=%s' % 'read-only'
resp = self.client.put(self.library_url, data, 'application/x-www-form-urlencoded')
self.assertEqual(200, resp.status_code)
@@ -142,7 +142,7 @@ class AdminLibraryTest(BaseTestCase):
json_resp = json.loads(resp.content)
assert json_resp['status'] == 'read-only'
data = 'status=%s' % 0
data = 'status=%s' % 'normal'
resp = self.client.put(self.library_url, data, 'application/x-www-form-urlencoded')
self.assertEqual(200, resp.status_code)
@@ -154,7 +154,7 @@ class AdminLibraryTest(BaseTestCase):
self.login_as(self.admin)
data = 'status=%s' % -1
data = 'status=%s' % 'invalid_args'
resp = self.client.put(self.library_url, data, 'application/x-www-form-urlencoded')
self.assertEqual(400, resp.status_code)

View File

@@ -116,7 +116,7 @@ class RepoViewTest(BaseTestCase):
def test_delete_with_read_only_status(self):
self.login_as(self.user)
seafile_api.set_repo_status(self.repo.id, int(1))
seafile_api.set_repo_status(self.repo.id, 1)
resp = self.client.delete(self.url)
self.assertEqual(403, resp.status_code)

View File

@@ -79,7 +79,7 @@ class RepoTest(BaseTestCase):
self.login_as(self.user)
seafile_api.set_repo_status(self.repo.id, int(1))
seafile_api.set_repo_status(self.repo.id, 1)
invalid_name = '123456'
data = {'repo_name': invalid_name}