#19 Tests
* 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:
@@ -21,7 +21,7 @@ class CompensationWorkflowTestCase(BaseWorkflowTestCase):
|
||||
super().setUpTestData()
|
||||
|
||||
# Give the user shared access to the dummy intervention -> inherits the access to the compensation
|
||||
cls.intervention.users.add(cls.superuser)
|
||||
cls.intervention.share_with(cls.superuser)
|
||||
|
||||
# Make sure the intervention itself would be fine with valid data
|
||||
cls.intervention = cls.fill_out_intervention(cls.intervention)
|
||||
@@ -142,7 +142,7 @@ class EcoAccountWorkflowTestCase(BaseWorkflowTestCase):
|
||||
|
||||
# Add user to conservation office group and give shared access to the account
|
||||
cls.superuser.groups.add(cls.groups.get(name=ETS_GROUP))
|
||||
cls.eco_account.users.set([cls.superuser])
|
||||
cls.eco_account.share_with_list([cls.superuser])
|
||||
|
||||
def test_deductability(self):
|
||||
"""
|
||||
@@ -154,7 +154,7 @@ class EcoAccountWorkflowTestCase(BaseWorkflowTestCase):
|
||||
|
||||
"""
|
||||
# Give user shared access to the dummy intervention, which will be needed here
|
||||
self.intervention.users.add(self.superuser)
|
||||
self.intervention.share_with(self.superuser)
|
||||
|
||||
# Prepare data for deduction creation
|
||||
deduct_url = reverse("compensation:acc-new-deduction", args=(self.eco_account.id,))
|
||||
|
||||
Reference in New Issue
Block a user