Skip to content

Commit

Permalink
test: fixes "list taxonomies for org" test URL
Browse files Browse the repository at this point in the history
Was requesting org=$orgA instead of org=orgA, and so wasn't testing the
queries we needed to test.
  • Loading branch information
pomegranited committed Feb 7, 2024
1 parent 4a46ae9 commit 0a3ada3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,15 @@ def test_list_taxonomy_query_count(self):
"""
Test how many queries are used when retrieving taxonomies and permissions
"""
url = TAXONOMY_ORG_LIST_URL + f'?org=${self.orgA.short_name}&enabled=true'
url = TAXONOMY_ORG_LIST_URL + f'?org={self.orgA.short_name}&enabled=true'

self.client.force_authenticate(user=self.staff)
with self.assertNumQueries(16): # TODO Why so many queries?
with self.assertNumQueries(23): # TODO Why so many queries?
response = self.client.get(url)

assert response.status_code == 200
assert response.data["can_add_taxonomy"]
assert len(response.data["results"]) == 2
assert len(response.data["results"]) == 4
for taxonomy in response.data["results"]:
if taxonomy["system_defined"]:
assert not taxonomy["can_change_taxonomy"]
Expand Down

0 comments on commit 0a3ada3

Please sign in to comment.