File tree Expand file tree Collapse file tree 1 file changed +1
-22
lines changed
enterprise_access/apps/customer_billing/tests Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change 2828from enterprise_access .apps .customer_billing .stripe_event_handlers import StripeEventHandler
2929from enterprise_access .apps .provisioning .models import GetCreateSubscriptionPlanStep
3030from enterprise_access .apps .provisioning .tests .factories import ProvisionNewCustomerWorkflowFactory
31+ from enterprise_access .apps .customer_billing .tests .test_stripe_event_handlers import AttrDict
3132
3233User = 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
5837class TestCheckoutIntentModel (TestCase ):
5938 """
You can’t perform that action at this time.
0 commit comments