Skip to content

Commit 7e58543

Browse files
authored
fix: remove extra code
1 parent e934b9f commit 7e58543

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

enterprise_access/apps/customer_billing/tests/test_models.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,11 @@
2828
from enterprise_access.apps.customer_billing.stripe_event_handlers import StripeEventHandler
2929
from enterprise_access.apps.provisioning.models import GetCreateSubscriptionPlanStep
3030
from enterprise_access.apps.provisioning.tests.factories import ProvisionNewCustomerWorkflowFactory
31+
from enterprise_access.apps.customer_billing.tests.test_stripe_event_handlers import AttrDict
3132

3233
User = get_user_model()
3334

3435

35-
class AttrDict(dict):
36-
"""
37-
Minimal helper that allows both attribute (obj.foo) and item (obj['foo']) access.
38-
Recursively converts nested dicts to AttrDicts, but leaves non-dict values as-is.
39-
"""
40-
def __getattr__(self, name):
41-
try:
42-
value = self[name]
43-
except KeyError as e:
44-
raise AttributeError(name) from e
45-
return value
46-
47-
def __setattr__(self, name, value):
48-
self[name] = value
49-
50-
@staticmethod
51-
def wrap(value):
52-
if isinstance(value, dict) and not isinstance(value, AttrDict):
53-
return AttrDict({k: AttrDict.wrap(v) for k, v in value.items()})
54-
return value
55-
56-
5736
@ddt.ddt
5837
class TestCheckoutIntentModel(TestCase):
5938
"""

0 commit comments

Comments
 (0)