Skip to content

Commit

Permalink
Merge pull request #11417 from archesproject/jtw/fix-noisy-test
Browse files Browse the repository at this point in the history
Fix noisy test
  • Loading branch information
whatisgalen authored Aug 31, 2024
2 parents 3449318 + 415fa2f commit f6ee7be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions tests/permissions/permission_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ def test_user_has_resource_model_permissions(self):
resource = ResourceInstance.objects.get(
resourceinstanceid=self.resource_instance_id
)
nodes = Node.objects.filter(graph_id=resource.graph_id)
nodes = (
Node.objects.filter(graph_id=resource.graph_id)
.exclude(nodegroup__isnull=True)
.select_related("nodegroup")
)
for node in nodes:
if node.nodegroup:
assign_perm("no_access_to_nodegroup", self.group, node.nodegroup)
assign_perm("no_access_to_nodegroup", self.group, node.nodegroup)
hasperms = user_has_resource_model_permissions(
self.user, ["models.read_nodegroup"], resource
)
Expand Down
3 changes: 2 additions & 1 deletion tests/views/search_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ def test_search_with_bad_searchview(self):
"""
query = {"search-view": "unavailable-search-view"}
response_json = get_response_json(self.client, query=query)
with self.assertLogs("django.request", level="WARNING"):
response_json = get_response_json(self.client, query=query)
self.assertFalse(response_json["success"])

def test_searchview_searchview_component_from_admin(self):
Expand Down

0 comments on commit f6ee7be

Please sign in to comment.