forked from DGNum/gestioCOF
kfet.tests -- Add tests for perform_operations view
This commit is contained in:
parent
22011faba9
commit
507a59c914
2 changed files with 1437 additions and 8 deletions
File diff suppressed because it is too large
Load diff
|
@ -178,7 +178,9 @@ class ViewTestCaseMixin(TestCaseMixin):
|
||||||
During setup, three users are created with their kfet account:
|
During setup, three users are created with their kfet account:
|
||||||
- 'user': a basic user without any permission, account trigramme: 000,
|
- 'user': a basic user without any permission, account trigramme: 000,
|
||||||
- 'team': a user with kfet.is_team permission, account trigramme: 100,
|
- 'team': a user with kfet.is_team permission, account trigramme: 100,
|
||||||
- 'root': a superuser, account trigramme: 200.
|
- 'root': a superuser, account trigramme: 200,
|
||||||
|
- 'liq': if class attribute 'with_liq' is 'True', account
|
||||||
|
trigramme: LIQ.
|
||||||
Their password is their username.
|
Their password is their username.
|
||||||
|
|
||||||
One can create additionnal users with 'get_users_extra' method, or prevent
|
One can create additionnal users with 'get_users_extra' method, or prevent
|
||||||
|
@ -221,6 +223,8 @@ class ViewTestCaseMixin(TestCaseMixin):
|
||||||
auth_user = None
|
auth_user = None
|
||||||
auth_forbidden = []
|
auth_forbidden = []
|
||||||
|
|
||||||
|
with_liq = False
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""
|
"""
|
||||||
Warning: Do not forget to call super().setUp() in subclasses.
|
Warning: Do not forget to call super().setUp() in subclasses.
|
||||||
|
@ -262,7 +266,7 @@ class ViewTestCaseMixin(TestCaseMixin):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Format desc: username, password, trigramme
|
# Format desc: username, password, trigramme
|
||||||
return {
|
users_base = {
|
||||||
# user, user, 000
|
# user, user, 000
|
||||||
'user': create_user(),
|
'user': create_user(),
|
||||||
# team, team, 100
|
# team, team, 100
|
||||||
|
@ -270,6 +274,9 @@ class ViewTestCaseMixin(TestCaseMixin):
|
||||||
# root, root, 200
|
# root, root, 200
|
||||||
'root': create_root(),
|
'root': create_root(),
|
||||||
}
|
}
|
||||||
|
if self.with_liq:
|
||||||
|
users_base['liq'] = create_user('liq', 'LIQ')
|
||||||
|
return users_base
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def users_base(self):
|
def users_base(self):
|
||||||
|
|
Loading…
Reference in a new issue