Skip to content

Commit

Permalink
Change 'workspace' to 'workspaces'
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirdp committed Mar 14, 2024
1 parent 37f781f commit a04e85d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion primed/cdsa/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions primed/cdsa/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down
2 changes: 1 addition & 1 deletion primed/dbgap/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions primed/dbgap/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down
4 changes: 2 additions & 2 deletions primed/templates/cdsa/cdsaworkspace_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ <h2 class="accordion-header" id="headingAcknowledgments">
<h2 class="accordion-header" id="headingDataPrepWorkspace">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDataPrepWorkspace" aria-expanded="false" aria-controls="collapseDataPrepWorkspace">
<span class="fa-solid fa-computer mx-2"></span>
Associated data prep workspace
Associated data prep workspaces
</button>
</h2>
<div id="collapseDataPrepWorkspace" class="accordion-collapse collapse" aria-labelledby="headingDataPrepWorkspace" data-bs-parent="#accordionDataPrepWorkspace">
<div class="accordion-body">
{% render_table associated_data_prep_workspace %}
{% render_table associated_data_prep_workspaces %}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions primed/templates/dbgap/dbgapworkspace_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ <h2 class="accordion-header" id="headingAcknowledgments">
<h2 class="accordion-header" id="headingDataPrepWorkspace">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDataPrepWorkspace" aria-expanded="false" aria-controls="collapseDataPrepWorkspace">
<span class="fa-solid fa-computer mx-2"></span>
Associated data prep workspace
Associated data prep workspaces
</button>
</h2>
<div id="collapseDataPrepWorkspace" class="accordion-collapse collapse" aria-labelledby="headingDataPrepWorkspace" data-bs-parent="#accordionDataPrepWorkspace">
<div class="accordion-body">
{% render_table associated_data_prep_workspace %}
{% render_table associated_data_prep_workspaces %}
</div>
</div>
</div>
Expand Down

0 comments on commit a04e85d

Please sign in to comment.