Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stripe_fixtures: Fix incorrectly normalized JSON.
Anders Kaseorg219fc360510a
diff --git a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.1.json b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.1.jsonindex f9689a7cfb6..2620a392d88 100644--- a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.1.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.2.json b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.2.jsonindex d5fcab1004c..35fcca7f6ec 100644--- a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.2.json+++ b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.create.2.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.1.json b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.1.jsonindex 6b64687baa4..7313a2152a0 100644--- a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.1.json+++ b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.1.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.2.json b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.2.jsonindex db86e98e575..6f79a5756ed 100644--- a/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.2.json+++ b/corporate/tests/stripe_fixtures/attach_discount_to_realm--Charge.list.2.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},@@ -147,7 +147,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/billing_page_permissions--Charge.create.1.json b/corporate/tests/stripe_fixtures/billing_page_permissions--Charge.create.1.jsonindex 4658164dff7..850efd1f73f 100644--- a/corporate/tests/stripe_fixtures/billing_page_permissions--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/billing_page_permissions--Charge.create.1.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/invoice_plan--Charge.create.1.json b/corporate/tests/stripe_fixtures/invoice_plan--Charge.create.1.jsonindex 4658164dff7..850efd1f73f 100644--- a/corporate/tests/stripe_fixtures/invoice_plan--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/invoice_plan--Charge.create.1.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/replace_payment_source--Charge.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_source--Charge.create.1.jsonindex 4658164dff7..850efd1f73f 100644--- a/corporate/tests/stripe_fixtures/replace_payment_source--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_source--Charge.create.1.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/replace_payment_source--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/replace_payment_source--Invoice.pay.1.jsonindex f47d53b8166..6083899e299 100644--- a/corporate/tests/stripe_fixtures/replace_payment_source--Invoice.pay.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_source--Invoice.pay.1.json@@ -80,7 +80,7 @@"network_status": "declined_by_network","reason": "generic_decline","risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "The bank did not return any further details with this decline.","type": "issuer_declined"},diff --git a/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_automatic_license_management--Charge.create.1.json b/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_automatic_license_management--Charge.create.1.jsonindex 1d47b5d3578..ec20193c31f 100644--- a/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_automatic_license_management--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_automatic_license_management--Charge.create.1.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_manual_license_management--Charge.create.1.json b/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_manual_license_management--Charge.create.1.jsonindex bea8e4b1fb5..047eb12da3d 100644--- a/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_manual_license_management--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/switch_from_monthly_plan_to_annual_plan_for_manual_license_management--Charge.create.1.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.create.1.jsonindex 97aa7b597c8..abbe645d532 100644--- a/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.create.1.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.list.1.jsonindex 447424d5304..b3bbff411e6 100644--- a/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.list.1.json+++ b/corporate/tests/stripe_fixtures/upgrade_by_card--Charge.list.1.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.create.1.jsonindex 97aa7b597c8..abbe645d532 100644--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.create.1.json+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.create.1.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.jsonindex 447424d5304..b3bbff411e6 100644--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.create.2.json b/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.create.2.jsonindex de4cc4e7c14..3a826bb223d 100644--- a/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.create.2.json+++ b/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.create.2.json@@ -39,7 +39,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},diff --git a/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.1.json b/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.1.jsonindex 555cc041190..d11322e442c 100644--- a/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.1.json+++ b/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.1.json@@ -41,7 +41,7 @@"network_status": "declined_by_network","reason": "generic_decline","risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "The bank did not return any further details with this decline.","type": "issuer_declined"},diff --git a/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.2.json b/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.2.jsonindex 5ade12e452e..d5d988f3cbb 100644--- a/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.2.json+++ b/corporate/tests/stripe_fixtures/upgrade_where_first_card_fails--Charge.list.2.json@@ -41,7 +41,7 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "Payment complete.","type": "authorized"},@@ -147,7 +147,7 @@"network_status": "declined_by_network","reason": "generic_decline","risk_level": "normal",- "risk_score": 00,+ "risk_score": 0,"seller_message": "The bank did not return any further details with this decline.","type": "issuer_declined"},diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex e1cf9e02feb..136a0383d17 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -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