diff --git a/primed/cdsa/adapters.py b/primed/cdsa/adapters.py index dd37688e..51305761 100644 --- a/primed/cdsa/adapters.py +++ b/primed/cdsa/adapters.py @@ -27,7 +27,7 @@ def get_extra_detail_context_data(self, workspace, request): associated_data_prep = Workspace.objects.filter( dataprepworkspace__target_workspace=workspace ) - extra_context["associated_data_prep_workspace"] = DataPrepWorkspaceTable( + extra_context["associated_data_prep_workspaces"] = DataPrepWorkspaceTable( associated_data_prep ) return extra_context diff --git a/primed/cdsa/tests/test_views.py b/primed/cdsa/tests/test_views.py index 85aa7675..fcbfe564 100644 --- a/primed/cdsa/tests/test_views.py +++ b/primed/cdsa/tests/test_views.py @@ -7262,30 +7262,30 @@ def test_render_duo_modifiers(self): self.assertContains(response, modifiers[0].abbreviation) self.assertContains(response, modifiers[1].abbreviation) - def test_associated_data_prep_workspace_context_exists(self): + def test_associated_data_prep_workspaces_context_exists(self): obj = factories.CDSAWorkspaceFactory.create() self.client.force_login(self.user) response = self.client.get(obj.get_absolute_url()) - self.assertIn("associated_data_prep_workspace", response.context_data) + self.assertIn("associated_data_prep_workspaces", response.context_data) self.assertIsInstance( - response.context_data["associated_data_prep_workspace"], + response.context_data["associated_data_prep_workspaces"], DataPrepWorkspaceTable, ) - def test_only_show_correct_associated_data_prep_workspace(self): + def test_only_show_one_associated_data_prep_workspace(self): cdsa_obj = factories.CDSAWorkspaceFactory.create() dataPrep_obj = DataPrepWorkspaceFactory.create( target_workspace=cdsa_obj.workspace ) self.client.force_login(self.user) response = self.client.get(cdsa_obj.get_absolute_url()) - self.assertIn("associated_data_prep_workspace", response.context_data) + self.assertIn("associated_data_prep_workspaces", response.context_data) self.assertEqual( - len(response.context_data["associated_data_prep_workspace"].rows), 1 + len(response.context_data["associated_data_prep_workspaces"].rows), 1 ) self.assertIn( dataPrep_obj.workspace, - response.context_data["associated_data_prep_workspace"].data, + response.context_data["associated_data_prep_workspaces"].data, ) diff --git a/primed/dbgap/adapters.py b/primed/dbgap/adapters.py index 5315e764..485fb507 100644 --- a/primed/dbgap/adapters.py +++ b/primed/dbgap/adapters.py @@ -25,7 +25,7 @@ def get_extra_detail_context_data(self, workspace, request): associated_data_prep = Workspace.objects.filter( dataprepworkspace__target_workspace=workspace ) - extra_context["associated_data_prep_workspace"] = DataPrepWorkspaceTable( + extra_context["associated_data_prep_workspaces"] = DataPrepWorkspaceTable( associated_data_prep ) return extra_context diff --git a/primed/dbgap/tests/test_views.py b/primed/dbgap/tests/test_views.py index 5b880395..7e603c37 100644 --- a/primed/dbgap/tests/test_views.py +++ b/primed/dbgap/tests/test_views.py @@ -953,30 +953,30 @@ def test_links_audit_access_view_permission(self): ), ) - def test_associated_data_prep_workspace_context_exists(self): + def test_associated_data_prep_workspaces_context_exists(self): obj = factories.dbGaPWorkspaceFactory.create() self.client.force_login(self.user) response = self.client.get(obj.get_absolute_url()) - self.assertIn("associated_data_prep_workspace", response.context_data) + self.assertIn("associated_data_prep_workspaces", response.context_data) self.assertIsInstance( - response.context_data["associated_data_prep_workspace"], + response.context_data["associated_data_prep_workspaces"], DataPrepWorkspaceTable, ) - def test_only_show_correct_associated_data_prep_workspace(self): + def test_only_show_one_associated_data_prep_workspace(self): dbGaP_obj = factories.dbGaPWorkspaceFactory.create() dataPrep_obj = DataPrepWorkspaceFactory.create( target_workspace=dbGaP_obj.workspace ) self.client.force_login(self.user) response = self.client.get(dbGaP_obj.get_absolute_url()) - self.assertIn("associated_data_prep_workspace", response.context_data) + self.assertIn("associated_data_prep_workspaces", response.context_data) self.assertEqual( - len(response.context_data["associated_data_prep_workspace"].rows), 1 + len(response.context_data["associated_data_prep_workspaces"].rows), 1 ) self.assertIn( dataPrep_obj.workspace, - response.context_data["associated_data_prep_workspace"].data, + response.context_data["associated_data_prep_workspaces"].data, ) diff --git a/primed/templates/cdsa/cdsaworkspace_detail.html b/primed/templates/cdsa/cdsaworkspace_detail.html index e1fbd3bd..d949ade9 100644 --- a/primed/templates/cdsa/cdsaworkspace_detail.html +++ b/primed/templates/cdsa/cdsaworkspace_detail.html @@ -87,12 +87,12 @@