1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

[tests] Add tests

This commit is contained in:
zhengxie
2018-12-06 13:47:59 +08:00
parent 13834d3a67
commit 3dcdb7aec2
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import json
from seahub.test_utils import BaseTestCase
class DownloadRepoViewTest(BaseTestCase):
def test_get(self, ):
url = '/api2/repos/%s/download-info/' % self.repo.id
self.login_as(self.user)
resp = self.client.get(url)
info = json.loads(resp.content)
self.assertIsNotNone(info['relay_addr'])
self.assertIsNotNone(info['token'])
self.assertIsNotNone(info['repo_id'])
self.assertIsNotNone(info['relay_port'])
self.assertIsNotNone(info['encrypted'])
self.assertIsNotNone(info['repo_name'])
self.assertIsNotNone(info['relay_id'])
self.assertIsNotNone(info['email'])