Skip to content

Commit

Permalink
Use quotation marks for all id value tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Mar 9, 2021
1 parent 83e1d90 commit c2aa29b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/server/middleware/test_api_hint.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_correct_api_hint(both_clients, check_response):

links_id = "index"
major_version = BASE_URL_PREFIXES["major"][1:] # Remove prefixed `/`
query_url = f"/links?api_hint={major_version}&filter=id={links_id}"
query_url = f'/links?api_hint={major_version}&filter=id="{links_id}"'

check_response(
request=query_url,
Expand All @@ -27,7 +27,7 @@ def test_incorrect_api_hint(both_clients, check_error_response):
links_id = "index"
incorrect_version = int(BASE_URL_PREFIXES["major"][len("/v") :]) + 1
incorrect_version = f"v{incorrect_version}"
query_url = f"/links?api_hint={incorrect_version}&filter=id={links_id}"
query_url = f'/links?api_hint={incorrect_version}&filter=id="{links_id}"'

with pytest.raises(VersionNotSupported):
check_error_response(
Expand All @@ -52,7 +52,7 @@ def test_url_changes(both_clients, get_good_response):

links_id = "index"
major_version = BASE_URL_PREFIXES["major"][1:] # Remove prefixed `/`
query_url = f"/links?filter=id={links_id}&api_hint={major_version}"
query_url = f'/links?filter=id="{links_id}"&api_hint={major_version}'

response = get_good_response(query_url, server=both_clients, return_json=False)

Expand All @@ -62,7 +62,7 @@ def test_url_changes(both_clients, get_good_response):
)

# Now to make sure the redirect would not happen when leaving out `api_hint`
query_url = f"/links?filter=id={links_id}"
query_url = f'/links?filter=id="{links_id}"'

response = get_good_response(query_url, server=both_clients, return_json=False)

Expand Down
2 changes: 1 addition & 1 deletion tests/server/query_params/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_custom_field(check_response):


def test_id(check_response):
request = "/structures?filter=id=mpf_2"
request = '/structures?filter=id="mpf_2"'
expected_ids = ["mpf_2"]
check_response(request, expected_ids)

Expand Down
6 changes: 3 additions & 3 deletions tests/server/routers/test_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_structures_endpoint_data(self):
class TestMultiStructureWithSharedRelationships(RegularEndpointTests):
"""Tests for /structures for entries with shared relationships"""

request_str = "/structures?filter=id=mpf_1 OR id=mpf_2"
request_str = '/structures?filter=id="mpf_1" OR id="mpf_2"'
response_cls = StructureResponseMany

def test_structures_endpoint_data(self):
Expand All @@ -126,7 +126,7 @@ def test_structures_endpoint_data(self):
class TestMultiStructureWithRelationships(RegularEndpointTests):
"""Tests for /structures for mixed entries with and without relationships"""

request_str = "/structures?filter=id=mpf_1 OR id=mpf_23"
request_str = '/structures?filter=id="mpf_1" OR id="mpf_23"'
response_cls = StructureResponseMany

def test_structures_endpoint_data(self):
Expand All @@ -145,7 +145,7 @@ class TestMultiStructureWithOverlappingRelationships(RegularEndpointTests):
some of these relationships overlap between the entries, others don't.
"""

request_str = "/structures?filter=id=mpf_1 OR id=mpf_3"
request_str = '/structures?filter=id="mpf_1" OR id="mpf_3"'
response_cls = StructureResponseMany

def test_structures_endpoint_data(self):
Expand Down

0 comments on commit c2aa29b

Please sign in to comment.