Skip to content

Commit c2aa29b

Browse files
committed
Use quotation marks for all id value tests
1 parent 83e1d90 commit c2aa29b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

tests/server/middleware/test_api_hint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_correct_api_hint(both_clients, check_response):
1111

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

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

3232
with pytest.raises(VersionNotSupported):
3333
check_error_response(
@@ -52,7 +52,7 @@ def test_url_changes(both_clients, get_good_response):
5252

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

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

@@ -62,7 +62,7 @@ def test_url_changes(both_clients, get_good_response):
6262
)
6363

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

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

tests/server/query_params/test_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_custom_field(check_response):
99

1010

1111
def test_id(check_response):
12-
request = "/structures?filter=id=mpf_2"
12+
request = '/structures?filter=id="mpf_2"'
1313
expected_ids = ["mpf_2"]
1414
check_response(request, expected_ids)
1515

tests/server/routers/test_structures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_structures_endpoint_data(self):
111111
class TestMultiStructureWithSharedRelationships(RegularEndpointTests):
112112
"""Tests for /structures for entries with shared relationships"""
113113

114-
request_str = "/structures?filter=id=mpf_1 OR id=mpf_2"
114+
request_str = '/structures?filter=id="mpf_1" OR id="mpf_2"'
115115
response_cls = StructureResponseMany
116116

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

129-
request_str = "/structures?filter=id=mpf_1 OR id=mpf_23"
129+
request_str = '/structures?filter=id="mpf_1" OR id="mpf_23"'
130130
response_cls = StructureResponseMany
131131

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

148-
request_str = "/structures?filter=id=mpf_1 OR id=mpf_3"
148+
request_str = '/structures?filter=id="mpf_1" OR id="mpf_3"'
149149
response_cls = StructureResponseMany
150150

151151
def test_structures_endpoint_data(self):

0 commit comments

Comments
 (0)