mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 21:30:39 +00:00
[api2] Add DISABLE_SYNC_WITH_ANY_FOLDER config to server info
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import json
|
||||
import unittest
|
||||
import requests
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from seahub import settings
|
||||
from tests.api.apitestbase import ApiTestBase
|
||||
from tests.api.urls import LIST_GROUP_AND_CONTACTS_URL, SERVER_INFO_URL
|
||||
|
||||
class MiscApiTest(ApiTestBase):
|
||||
class MiscApiTest(ApiTestBase, TestCase):
|
||||
def test_list_group_and_contacts(self):
|
||||
res = self.get(LIST_GROUP_AND_CONTACTS_URL).json()
|
||||
self.assertIsNotNone(res)
|
||||
@@ -20,3 +25,11 @@ class MiscApiTest(ApiTestBase):
|
||||
info = r.json()
|
||||
self.assertTrue('version' in info)
|
||||
self.assertTrue('seafile-basic' in info['features'])
|
||||
self.assertFalse('disable-sync-with-any-folder' in info['features'])
|
||||
|
||||
def test_server_info_with_disable_sync(self):
|
||||
settings.DISABLE_SYNC_WITH_ANY_FOLDER = True
|
||||
|
||||
resp = self.client.get('/api2/server-info/')
|
||||
info = json.loads(resp.content)
|
||||
self.assertTrue('disable-sync-with-any-folder' in info['features'])
|
||||
|
Reference in New Issue
Block a user