stripe_fixtures: Fix incorrectly normalized JSON.

JSON does not allow leading zeros.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-08-06 22:55:37 -07:00 committed by Tim Abbott
parent f63d132276
commit 219fc36051
18 changed files with 2 additions and 2 deletions

View File

@ -181,8 +181,8 @@ def normalize_fixture_data(decorated_function: CallableT,
if match not in normalized_values[pattern]:
normalized_values[pattern][match] = translation % (len(normalized_values[pattern]) + 1,)
file_content = file_content.replace(match, normalized_values[pattern][match])
file_content = re.sub(r'(?<="risk_score": )(\d+)', '00', file_content)
file_content = re.sub(r'(?<="times_redeemed": )(\d+)', '00', file_content)
file_content = re.sub(r'(?<="risk_score": )(\d+)', '0', file_content)
file_content = re.sub(r'(?<="times_redeemed": )(\d+)', '0', file_content)
file_content = re.sub(r'(?<="idempotency-key": )"([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f-]*)"',
'"00000000-0000-0000-0000-000000000000"', file_content)
# Dates