@@ -19,79 +19,33 @@ def currencies():
1919
2020
2121@pytest .fixture
22- def seller_factory (currencies ):
23- def _seller (
24- external_id : str , # Must be unique in Marketplace
25- name = "E2E Test Seller" ,
26- currencies = currencies ,
27- ):
28- return {
29- "name" : name ,
30- "address" : {
31- "addressLine1" : "123 Main St" ,
32- "city" : "Anytown" ,
33- "state" : "CA" ,
34- "postCode" : "12345" ,
35- "country" : "US" ,
36- },
37- "currencies" : currencies ,
38- "externalId" : external_id ,
39- }
40-
41- return _seller
22+ def account_id (e2e_config ):
23+ return e2e_config ["accounts.account.id" ]
4224
4325
4426@pytest .fixture
45- def account_factory ():
46- def _account (
47- name : str = "E2E Test Api Client Vendor" ,
48- ):
49- return {
50- "name" : name ,
51- "address" : {
52- "addressLine1" : "123 Test St" ,
53- "city" : "San Francisco" ,
54- "state" : "CA" ,
55- "postCode" : "12345" ,
56- "country" : "US" ,
57- },
58- "type" : "Vendor" ,
59- "status" : "Active" ,
60- }
27+ def seller_id (e2e_config ):
28+ return e2e_config ["accounts.seller.id" ]
6129
62- return _account
30+
31+ @pytest .fixture
32+ def buyer_id (e2e_config ):
33+ return e2e_config ["accounts.buyer.id" ]
6334
6435
6536@pytest .fixture
66- def buyer_factory (buyer_account_id ):
67- def _buyer (
68- name = "E2E Created Buyer" ,
69- account_id : str = buyer_account_id ,
70- ):
71- return {
72- "name" : name ,
73- "account" : {
74- "id" : account_id ,
75- },
76- "contact" : {
77- "firstName" : "first" ,
78- "lastName" : "last" ,
79- "email" : "created.buyer@example.com" ,
80- },
81- "address" : {
82- "addressLine1" : "123 Main St" ,
83- "city" : "Anytown" ,
84- "state" : "CA" ,
85- "postCode" : "12345" ,
86- "country" : "US" ,
87- },
88- }
37+ def user_group_id (e2e_config ):
38+ return e2e_config ["accounts.user_group.id" ]
39+
8940
90- return _buyer
41+ @pytest .fixture
42+ def module_id (e2e_config ):
43+ return e2e_config ["accounts.module.id" ]
9144
9245
9346@pytest .fixture
9447def user_group_factory (account_id , module_id ):
48+ # Used in user group and licensee fixtures
9549 def _user_group (
9650 name : str = "E2E Test Api Client User Group" ,
9751 user_group_account_id : str = account_id ,
@@ -106,51 +60,3 @@ def _user_group(
10660 }
10761
10862 return _user_group
109-
110-
111- @pytest .fixture
112- def api_token_factory (account_id , module_id ):
113- def _api_token (
114- name : str = "E2E Test API Token" ,
115- description : str = "E2E API Token created during E2E tests" ,
116- ):
117- return {
118- "account" : {"id" : account_id },
119- "name" : name ,
120- "description" : description ,
121- "icon" : "" ,
122- "modules" : [{"id" : module_id }],
123- }
124-
125- return _api_token
126-
127-
128- @pytest .fixture
129- def licensee_factory (seller_id , buyer_id , user_group_factory , licensee_account_id ):
130- def _licensee (
131- name : str = "Test E2E Licensee" ,
132- licensee_type : str = "Client" ,
133- ):
134- group = user_group_factory (user_group_account_id = licensee_account_id )
135-
136- return {
137- "name" : name ,
138- "address" : {
139- "addressLine1" : "456 Licensee St" ,
140- "city" : "Los Angeles" ,
141- "state" : "CA" ,
142- "postCode" : "67890" ,
143- "country" : "US" ,
144- },
145- "useBuyerAddress" : False ,
146- "seller" : {"id" : seller_id },
147- "buyer" : {"id" : buyer_id },
148- "account" : {"id" : licensee_account_id },
149- "eligibility" : {"client" : True , "partner" : False },
150- "groups" : [group ],
151- "type" : licensee_type ,
152- "status" : "Enabled" ,
153- "defaultLanguage" : "en-US" ,
154- }
155-
156- return _licensee
0 commit comments