Unit test user app

* adds unit test for User model and forms
* refactors functions from user_checks.py into User class and drops user_checks.py
This commit is contained in:
2023-09-13 09:49:40 +02:00
parent 19baf7ba86
commit 9117abd1d8
14 changed files with 263 additions and 70 deletions

View File

@@ -4,7 +4,6 @@ from django.urls import reverse
from konova.settings import DEFAULT_GROUP
from konova.tests.test_views import BaseTestCase
from konova.utils.user_checks import is_default_group_only
class BaseAPIV1TestCase(BaseTestCase):
@@ -138,7 +137,7 @@ class APIV1SharingTestCase(BaseAPIV1TestCase):
# Give the user only default group rights
default_group = self.groups.get(name=DEFAULT_GROUP)
self.superuser.groups.set([default_group])
self.assertTrue(is_default_group_only(self.superuser))
self.assertTrue(self.superuser.is_default_group_only())
# Add only him as shared_users an object
self.intervention.users.set([self.superuser])