gestioCOF/gestioncof/tests/testcases.py

25 lines
794 B
Python
Raw Normal View History

2018-01-19 17:48:00 +01:00
from shared.tests.testcases import ViewTestCaseMixin as BaseViewTestCaseMixin
from .utils import create_member, create_staff, create_user
2018-01-19 17:48:00 +01:00
class ViewTestCaseMixin(BaseViewTestCaseMixin):
"""
TestCase extension to ease testing of cof views.
Most information can be found in the base parent class doc.
This class performs some changes to users management, detailed below.
During setup, three users are created:
- 'user': a basic user without any permission,
- 'member': (profile.is_cof is True),
- 'staff': (profile.is_cof is True) && (profile.is_buro is True).
"""
def get_users_base(self):
return {
"user": create_user("user"),
"member": create_member("member"),
"staff": create_staff("staff"),
2018-01-19 17:48:00 +01:00
}