forked from haiwen/seahub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_settings.py
123 lines (120 loc) · 3.68 KB
/
test_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
from .settings import *
# no cache for testing
# CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
# }
# }
# enlarge api throttle
REST_FRAMEWORK = {
'DEFAULT_THROTTLE_RATES': {
'ping': '90000/minute',
'anon': '90000/minute',
'user': '90000/minute',
},
}
# Use static file storage instead of cached, since the cached need to run collect
# command first.
# admin roles for test
ENABLED_ADMIN_ROLE_PERMISSIONS = {
'cannot_view_system_info': {
'can_view_system_info': False,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_view_statistic': {
'can_view_system_info': True,
'can_view_statistic': False,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_config_system': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': False,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_manage_library': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': False,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_manage_user': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': False,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_manage_group': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': False,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_view_user_log': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': False,
'can_view_admin_log': True,
'other_permission': True,
},
'cannot_view_admin_log': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': False,
'other_permission': True,
},
'no_other_permission': {
'can_view_system_info': True,
'can_view_statistic': True,
'can_config_system': True,
'can_manage_library': True,
'can_manage_user': True,
'can_manage_group': True,
'can_view_user_log': True,
'can_view_admin_log': True,
'other_permission': False,
},
}
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'