* refactors sharing user setting by introducing share_with(user) and share_with_list(user_list) for BaseObject for a more self-explanatory sharing
This commit is contained in:
2021-11-11 15:09:03 +01:00
parent a5e816c67b
commit 6c35fc59af
15 changed files with 58 additions and 36 deletions

View File

@@ -116,7 +116,7 @@ class InterventionViewTestCase(BaseViewTestCase):
# Add user to default group
default_group = Group.objects.get(name=DEFAULT_GROUP)
self.superuser.groups.set([default_group])
self.intervention.users.set([self.superuser])
self.intervention.share_with_list([self.superuser])
success_urls = [
self.index_url,
@@ -156,7 +156,7 @@ class InterventionViewTestCase(BaseViewTestCase):
# Add user to default group
default_group = Group.objects.get(name=DEFAULT_GROUP)
self.superuser.groups.set([default_group])
self.intervention.users.set([])
self.intervention.share_with_list([])
success_urls = [
self.index_url,
@@ -196,7 +196,7 @@ class InterventionViewTestCase(BaseViewTestCase):
# Add user to zb group
zb_group = self.groups.get(name=ZB_GROUP)
self.superuser.groups.set([zb_group])
self.intervention.users.set([self.superuser])
self.intervention.share_with_list([self.superuser])
success_urls = [
self.index_url,
@@ -236,7 +236,7 @@ class InterventionViewTestCase(BaseViewTestCase):
# Add user to zb group
zb_group = self.groups.get(name=ZB_GROUP)
self.superuser.groups.set([zb_group])
self.intervention.users.set([])
self.intervention.share_with_list([])
success_urls = [
self.index_url,
@@ -276,7 +276,7 @@ class InterventionViewTestCase(BaseViewTestCase):
# Add user to ets group
ets_group = Group.objects.get(name=ETS_GROUP)
self.superuser.groups.set([ets_group])
self.intervention.users.set([self.superuser])
self.intervention.share_with_list([self.superuser])
success_urls = [
self.index_url,
@@ -316,7 +316,7 @@ class InterventionViewTestCase(BaseViewTestCase):
# Add user to default group
ets_group = Group.objects.get(name=ETS_GROUP)
self.superuser.groups.set([ets_group])
self.intervention.users.set([])
self.intervention.share_with_list([])
success_urls = [
self.index_url,