From 6cabcc0f3e0c7b7e8666c3862a97190a72a03d2a Mon Sep 17 00:00:00 2001 From: FanouZeng-TT <18280587072@163.com> Date: Tue, 11 Aug 2026 20:05:17 +0800 Subject: [PATCH 1/2] fix: use configured discount code in totals test --- totals_test.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/totals_test.py b/totals_test.py index 2bb64b2..ee73f93 100644 --- a/totals_test.py +++ b/totals_test.py @@ -47,11 +47,6 @@ # Entry types whose amount MUST be negative (total.json: exclusiveMaximum 0). _NEGATIVE_TYPES = frozenset({"discount", "items_discount"}) -# A percentage discount code recognized by the reference data set. If the -# server under test does not recognize it, the discount-sign test skips. -_DISCOUNT_CODE = "10OFF" - - class TotalsTest(integration_test_utils.IntegrationTestBase): """Structural-integrity tests for the checkout ``totals`` breakdown. @@ -85,8 +80,9 @@ def _discounted_checkout_totals(self) -> list[dict]: """ checkout_json = self.create_checkout_session(select_fulfillment=True) checkout_obj = checkout.Checkout(**checkout_json) + discount_code = self.fixture_ctx.get_test_discount_code() updated = self.update_checkout_session( - checkout_obj, discounts={"codes": [_DISCOUNT_CODE]} + checkout_obj, discounts={"codes": [discount_code]} ) totals = updated.get("totals") self.assertIsInstance( From a8ed5aa03dbfa0c553133d564ccfb93ae45e7844 Mon Sep 17 00:00:00 2001 From: damaz91 Date: Tue, 11 Aug 2026 13:53:07 +0000 Subject: [PATCH 2/2] style: format code --- totals_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/totals_test.py b/totals_test.py index ee73f93..74bab34 100644 --- a/totals_test.py +++ b/totals_test.py @@ -47,6 +47,7 @@ # Entry types whose amount MUST be negative (total.json: exclusiveMaximum 0). _NEGATIVE_TYPES = frozenset({"discount", "items_discount"}) + class TotalsTest(integration_test_utils.IntegrationTestBase): """Structural-integrity tests for the checkout ``totals`` breakdown.