diff --git a/gregor_django/gregor_anvil/tests/test_views.py b/gregor_django/gregor_anvil/tests/test_views.py index 3c9c162c..0e7311da 100644 --- a/gregor_django/gregor_anvil/tests/test_views.py +++ b/gregor_django/gregor_anvil/tests/test_views.py @@ -961,6 +961,11 @@ def setUp(self): codename=acm_models.AnVILProjectManagerAccess.VIEW_PERMISSION_CODENAME ) ) + self.user.user_permissions.add( + Permission.objects.get( + codename=acm_models.AnVILProjectManagerAccess.EDIT_PERMISSION_CODENAME + ) + ) self.object = factories.UploadWorkspaceFactory.create() def get_url(self, *args): @@ -977,6 +982,26 @@ def test_status_code(self): ) self.assertEqual(response.status_code, 200) + def test_contains_share_with_auth_domain_button(self): + acm_factories.WorkspaceAuthorizationDomainFactory.create( + workspace=self.object.workspace, group__name="test_auth" + ) + self.client.force_login(self.user) + response = self.client.get( + self.get_url( + self.object.workspace.billing_project.name, self.object.workspace.name + ) + ) + url = reverse( + "anvil_consortium_manager:workspaces:sharing:new_by_group", + args=[ + self.object.workspace.billing_project.name, + self.object.workspace.name, + "test_auth", + ], + ) + self.assertContains(response, url) + class UploadWorkspaceListTest(TestCase): """Tests of the anvil_consortium_manager WorkspaceList view using this app's adapter.""" @@ -1472,6 +1497,11 @@ def setUp(self): codename=acm_models.AnVILProjectManagerAccess.VIEW_PERMISSION_CODENAME ) ) + self.user.user_permissions.add( + Permission.objects.get( + codename=acm_models.AnVILProjectManagerAccess.EDIT_PERMISSION_CODENAME + ) + ) self.object = factories.CombinedConsortiumDataWorkspaceFactory.create() def get_url(self, *args): @@ -1540,6 +1570,26 @@ def test_contains_upload_workspaces_from_previous_cycles(self): upload_workspace_2, response.context_data["upload_workspace_table"].data ) + def test_contains_share_with_auth_domain_button(self): + acm_factories.WorkspaceAuthorizationDomainFactory.create( + workspace=self.object.workspace, group__name="test_auth" + ) + self.client.force_login(self.user) + response = self.client.get( + self.get_url( + self.object.workspace.billing_project.name, self.object.workspace.name + ) + ) + url = reverse( + "anvil_consortium_manager:workspaces:sharing:new_by_group", + args=[ + self.object.workspace.billing_project.name, + self.object.workspace.name, + "test_auth", + ], + ) + self.assertContains(response, url) + class ReleaseWorkspaceDetailTest(TestCase): """Tests of the anvil_consortium_manager WorkspaceDetail view using the ReleaseWorkspaceAdapter.""" diff --git a/gregor_django/templates/gregor_anvil/combinedconsortiumdataworkspace_detail.html b/gregor_django/templates/gregor_anvil/combinedconsortiumdataworkspace_detail.html index 95495cc6..bf43f32d 100644 --- a/gregor_django/templates/gregor_anvil/combinedconsortiumdataworkspace_detail.html +++ b/gregor_django/templates/gregor_anvil/combinedconsortiumdataworkspace_detail.html @@ -6,3 +6,19 @@
no auth domain
+ {% endif %} +{% endif %} + +{{ block.super }} +{% endblock action_buttons %} diff --git a/gregor_django/templates/gregor_anvil/uploadworkspace_detail.html b/gregor_django/templates/gregor_anvil/uploadworkspace_detail.html index 6fb1d913..e556e626 100644 --- a/gregor_django/templates/gregor_anvil/uploadworkspace_detail.html +++ b/gregor_django/templates/gregor_anvil/uploadworkspace_detail.html @@ -31,3 +31,17 @@no auth domain
+ {% endif %} +{% endif %} + +{{ block.super }} +{% endblock action_buttons %}