2020-05-10 23:54:21 +02:00
|
|
|
from shared.tests.testcases import (
|
|
|
|
CSVResponseMixin,
|
|
|
|
ViewTestCaseMixin as BaseViewTestCaseMixin,
|
|
|
|
)
|
2018-01-19 17:48:00 +01:00
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
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 {
|
2018-10-06 12:35:49 +02:00
|
|
|
"user": create_user("user"),
|
|
|
|
"member": create_member("member"),
|
|
|
|
"staff": create_staff("staff"),
|
2018-01-19 17:48:00 +01:00
|
|
|
}
|