fixed json payload

This commit is contained in:
Oscar Krause 2024-11-18 20:30:37 +01:00
parent e33024db86
commit a6b2f2a942

View File

@ -108,6 +108,7 @@ def test_auth_v1_origin():
def test_auth_v1_origin_malformed_json(): def test_auth_v1_origin_malformed_json():
import re import re
import json
# see oscar.krause/fastapi-dls#1 # see oscar.krause/fastapi-dls#1
payload = """{ payload = """{
@ -133,6 +134,7 @@ def test_auth_v1_origin_malformed_json():
assert replaced == '{"environment": {"fingerprint": {"mac_address_list": ["ff:ff:ff:ff:ff:ff"]}}' assert replaced == '{"environment": {"fingerprint": {"mac_address_list": ["ff:ff:ff:ff:ff:ff"]}}'
payload = re.sub(regex, r'\1"\2', payload) payload = re.sub(regex, r'\1"\2', payload)
payload = json.loads(payload)
# #
response = client.post('/auth/v1/origin', json=payload) response = client.post('/auth/v1/origin', json=payload)