From b73a6b7b06edeea62f396526a9427e4a916bd7f6 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 22 Dec 2021 23:44:51 -0800 Subject: [PATCH] =?UTF-8?q?test=5Fstripe:=20What=20even=20is=20how=20to=20?= =?UTF-8?q?code=20I=20don=E2=80=99t=20know=20help.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- corporate/tests/test_stripe.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py index 82082d4fc2..6a0625ce3e 100644 --- a/corporate/tests/test_stripe.py +++ b/corporate/tests/test_stripe.py @@ -4109,9 +4109,12 @@ class RequiresBillingAccessTest(StripeTestCase): # Make sure that we are testing all the JSON endpoints # Quite a hack, but probably fine for now - string_with_all_endpoints = str(get_resolver("corporate.urls").reverse_dict) + reverse_dict = get_resolver("corporate.urls").reverse_dict json_endpoints = { - word.strip("\"'()[],$") for word in string_with_all_endpoints.split() if "json/" in word + pat + for name in reverse_dict + for matches, pat, defaults, converters in reverse_dict.getlist(name) + if pat.startswith(re.escape("json/")) } self.assert_length(json_endpoints, len(tested_endpoints))