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

update log api

This commit is contained in:
lian
2016-04-13 10:40:23 +08:00
parent 2e3cf5f94f
commit 866aaed496
8 changed files with 87 additions and 8 deletions

View File

@@ -5,10 +5,19 @@ from mock import patch
from django.core.urlresolvers import reverse
from seahub.test_utils import BaseTestCase
try:
from seahub.settings import LOCAL_PRO_DEV_ENV
except ImportError:
LOCAL_PRO_DEV_ENV = False
class AccountTest(BaseTestCase):
@patch('seahub.views.file.is_pro_version')
def test_can_not_get_if_start_time_invalid(self, mock_is_pro_version):
if not LOCAL_PRO_DEV_ENV:
return
mock_is_pro_version.return_value = True
self.login_as(self.admin)
@@ -25,6 +34,10 @@ class AccountTest(BaseTestCase):
@patch('seahub.views.file.is_pro_version')
def test_can_not_get_if_end_time_invalid(self, mock_is_pro_version):
if not LOCAL_PRO_DEV_ENV:
return
mock_is_pro_version.return_value = True
self.login_as(self.admin)
@@ -40,6 +53,10 @@ class AccountTest(BaseTestCase):
self.assertEqual(400, resp.status_code)
def test_can_not_get_if_not_admin(self):
if not LOCAL_PRO_DEV_ENV:
return
self.login_as(self.user)
start_timestamp = time.time() - 7 * 24 * 60 * 60