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

update test

This commit is contained in:
lian
2021-11-25 17:32:41 +08:00
parent 8f1c13e68b
commit fece35af98
4 changed files with 21 additions and 55 deletions

View File

@@ -1,15 +1,14 @@
import json
import pytest
pytestmark = pytest.mark.django_db
from seaserv import seafile_api, ccnet_threaded_rpc
from seahub.test_utils import BaseTestCase
from mock import patch, MagicMock
from seaserv import seafile_api
from seahub.test_utils import BaseTestCase
pytestmark = pytest.mark.django_db
class RepoPublicTest(BaseTestCase):
def setUp(self):
from constance import config
self.config = config
@@ -20,8 +19,6 @@ class RepoPublicTest(BaseTestCase):
self.url = '/api2/shared-repos/%s/' % self.repo_id
self.user_repo_url = '/api2/shared-repos/%s/' % self.repo.id
self.config.ENABLE_USER_CREATE_ORG_REPO = 1
def tearDown(self):
self.remove_repo(self.repo_id)
# clear cache between every test case to avoid config option cache issue
@@ -63,9 +60,6 @@ class RepoPublicTest(BaseTestCase):
self.assertEqual(403, resp.status_code)
def test_admin_can_set_pub_repo_when_setting_disalbed(self):
assert bool(self.config.ENABLE_USER_CREATE_ORG_REPO) is True
self.config.ENABLE_USER_CREATE_ORG_REPO = False
assert bool(self.config.ENABLE_USER_CREATE_ORG_REPO) is False
self.login_as(self.admin)
@@ -75,9 +69,6 @@ class RepoPublicTest(BaseTestCase):
assert 'success' in json_resp
def test_user_can_not_set_pub_repo_when_setting_disalbed(self):
assert bool(self.config.ENABLE_USER_CREATE_ORG_REPO) is True
self.config.ENABLE_USER_CREATE_ORG_REPO = False
assert bool(self.config.ENABLE_USER_CREATE_ORG_REPO) is False
self.login_as(self.user)