-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstants.py
More file actions
101 lines (90 loc) · 2.54 KB
/
constants.py
File metadata and controls
101 lines (90 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
"""Read-only test-data templates for REST API tests.
Rules:
- Treat every value as read-only — always spread/copy:
payload = {**ORGANIZATION_TEMPLATE, "name": ...}
- No environment values (URLs, credentials).
- No test-created state (IDs, entity names produced during a run).
"""
MEMBER_TYPES = ["Contact", "Organization", "Employee", "Vendor"]
ADDRESS_TEMPLATE = {
"addressType": "BillingAndShipping",
"countryCode": "USA",
"countryName": "United States",
"city": "New York",
"line1": "123 Main St",
"postalCode": "10001",
"regionId": "NY",
}
ORGANIZATION_TEMPLATE = {
"memberType": "Organization",
"groups": ["Customers"],
"addresses": [ADDRESS_TEMPLATE],
}
CONTACT_TEMPLATE = {
"memberType": "Contact",
"firstName": "FirstName",
"lastName": "LastName",
"addresses": [ADDRESS_TEMPLATE],
}
DEFAULT_LANGUAGE = {"isDefault": True, "languageCode": "en-US"}
CATALOG_TEMPLATE = {
"isVirtual": False,
"defaultLanguage": DEFAULT_LANGUAGE,
"languages": [DEFAULT_LANGUAGE],
"createdDate": "0001-01-01T00:00:00Z",
}
CATEGORY_TEMPLATE = {
"isVirtual": False,
"level": 0,
"priority": 0,
"isActive": True,
"seoObjectType": "Category",
"seoInfos": [],
"isInherited": False,
"createdDate": "0001-01-01T00:00:00Z",
}
PRODUCT_TEMPLATE = {
"productType": "Physical",
"weightUnit": "kg",
"weight": "1.0",
"height": "10",
"width": "10",
"length": "10",
"images": [],
"reviews": [
{
"languageCode": "en-US",
"reviewType": "QuickReview",
"content": "Automated test product",
}
],
}
# Reference line item used by the Katalon-migrated order lifecycle tests —
# matches a product seeded into the dataset (orders.json).
ORDER_LINE_ITEM_TEMPLATE = {
"currency": "USD",
"price": 995.99,
"quantity": 1,
"productId": "product-acme-laptop-lenovo-ideapad-5i",
"sku": "product-acme-laptop-lenovo-ideapad-5i",
"productType": "Physical",
"catalogId": "catalog-acme",
"categoryId": "category-acme-laptops",
"name": "Lenovo Ideapad 5i",
"isGift": False,
"isCancelled": False,
"objectType": "VirtoCommerce.OrdersModule.Core.Model.LineItem",
}
ORDER_TEMPLATE = {
"isPrototype": False,
"objectType": "VirtoCommerce.OrdersModule.Core.Model.CustomerOrder",
"addresses": [],
"inPayments": [],
"shipments": [],
"discounts": [],
"status": "New",
"currency": "USD",
"childrenOperations": [],
"isCancelled": False,
"dynamicProperties": [],
}