Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add cassetes removed by mistake

Maciej Korycinskidd47cc9bd741
diff --git a/tests/extensions/plugins/cassettes/test_preprocess_order_creation.yaml b/tests/extensions/plugins/cassettes/test_preprocess_order_creation.yaml
new file mode 100644
index 0000000000..47b3b6122d
--- /dev/null
+++ b/tests/extensions/plugins/cassettes/test_preprocess_order_creation.yaml
@@ -0,0 +1,97 @@
+interactions:
+- request:
+ body: '{"createTransactionModel": {"companyCode": "DEFAULT", "type": "SalesOrder",
+ "lines": [{"quantity": 3, "amount": "15.00", "taxCode": "O9999999", "taxIncluded":
+ true, "itemCode": "123", "description": ""}, {"quantity": 1, "amount": "10.00",
+ "taxCode": "FR020100", "taxIncluded": true, "itemCode": "Shipping", "description":
+ ""}], "code": "aaac0cac-a6f0-4091-9d29-d0f096a8cd4d", "date": "2019-07-23",
+ "customerCode": 0, "addresses": {"shipFrom": {"line1": "2000 Main Street", "line2":
+ "", "city": "Irvine", "region": "CA", "country": "US", "postalCode": "92614"},
+ "shipTo": {"line1": "T\u0119czowa 7", "line2": "", "city": "WROC\u0141AW", "region":
+ "", "country": "PL", "postalCode": "53-601"}}, "commit": false, "currencyCode":
+ "USD", "email": ""}}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Authorization:
+ - Basic Og==
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '746'
+ User-Agent:
+ - python-requests/2.22.0
+ method: POST
+ uri: https://sandbox-rest.avatax.com/api/v2/transactions/createoradjust
+ response:
+ body:
+ string: "{\"id\":0,\"code\":\"aaac0cac-a6f0-4091-9d29-d0f096a8cd4d\",\"companyId\"\
+ :242975,\"date\":\"2019-07-23\",\"paymentDate\":\"2019-07-23\",\"status\"\
+ :\"Temporary\",\"type\":\"SalesOrder\",\"currencyCode\":\"USD\",\"customerVendorCode\"\
+ :\"0\",\"customerCode\":\"0\",\"reconciled\":false,\"totalAmount\":20.33,\"\
+ totalExempt\":0.0,\"totalDiscount\":0.0,\"totalTax\":4.67,\"totalTaxable\"\
+ :20.33,\"totalTaxCalculated\":4.67,\"adjustmentReason\":\"NotAdjusted\",\"\
+ locked\":false,\"version\":1,\"exchangeRateEffectiveDate\":\"2019-07-23\"\
+ ,\"exchangeRate\":1.0,\"email\":\"\",\"modifiedDate\":\"2019-07-23T13:43:31.8029148Z\"\
+ ,\"modifiedUserId\":283192,\"taxDate\":\"2019-07-23T00:00:00\",\"lines\":[{\"\
+ id\":0,\"transactionId\":0,\"lineNumber\":\"1\",\"description\":\"\",\"discountAmount\"\
+ :0.0,\"exemptAmount\":0.0,\"exemptCertId\":0,\"isItemTaxable\":true,\"itemCode\"\
+ :\"123\",\"lineAmount\":12.2,\"quantity\":3.0,\"reportingDate\":\"2019-07-23\"\
+ ,\"tax\":2.8,\"taxableAmount\":12.2,\"taxCalculated\":2.8,\"taxCode\":\"O9999999\"\
+ ,\"taxCodeId\":5340,\"taxDate\":\"2019-07-23\",\"taxIncluded\":true,\"details\"\
+ :[{\"id\":0,\"transactionLineId\":0,\"transactionId\":0,\"country\":\"PL\"\
+ ,\"region\":\"PL\",\"exemptAmount\":0.0,\"jurisCode\":\"PL\",\"jurisName\"\
+ :\"POLAND\",\"stateAssignedNo\":\"\",\"jurisType\":\"CNT\",\"jurisdictionType\"\
+ :\"Country\",\"nonTaxableAmount\":0.0,\"rate\":0.230000,\"tax\":2.8,\"taxableAmount\"\
+ :12.2,\"taxType\":\"Output\",\"taxSubTypeId\":\"O\",\"taxName\":\"Standard\
+ \ Rate\",\"taxAuthorityTypeId\":45,\"taxCalculated\":2.8,\"rateType\":\"Standard\"\
+ ,\"rateTypeCode\":\"S\",\"unitOfBasis\":\"PerCurrencyUnit\",\"isNonPassThru\"\
+ :false}],\"nonPassthroughDetails\":[],\"hsCode\":\"\",\"costInsuranceFreight\"\
+ :0.0,\"vatCode\":\"PLS-2300O--US\",\"vatNumberTypeId\":0},{\"id\":0,\"transactionId\"\
+ :0,\"lineNumber\":\"2\",\"description\":\"\",\"discountAmount\":0.0,\"exemptAmount\"\
+ :0.0,\"exemptCertId\":0,\"isItemTaxable\":true,\"itemCode\":\"Shipping\",\"\
+ lineAmount\":8.13,\"quantity\":1.0,\"reportingDate\":\"2019-07-23\",\"tax\"\
+ :1.87,\"taxableAmount\":8.13,\"taxCalculated\":1.87,\"taxCode\":\"FR020100\"\
+ ,\"taxCodeId\":4784,\"taxDate\":\"2019-07-23\",\"taxIncluded\":true,\"details\"\
+ :[{\"id\":0,\"transactionLineId\":0,\"transactionId\":0,\"country\":\"PL\"\
+ ,\"region\":\"PL\",\"exemptAmount\":0.0,\"jurisCode\":\"PL\",\"jurisName\"\
+ :\"POLAND\",\"stateAssignedNo\":\"\",\"jurisType\":\"CNT\",\"jurisdictionType\"\
+ :\"Country\",\"nonTaxableAmount\":0.0,\"rate\":0.230000,\"tax\":1.87,\"taxableAmount\"\
+ :8.13,\"taxType\":\"Output\",\"taxSubTypeId\":\"O\",\"taxName\":\"Standard\
+ \ Rate\",\"taxAuthorityTypeId\":45,\"taxCalculated\":1.87,\"rateType\":\"\
+ Standard\",\"rateTypeCode\":\"S\",\"unitOfBasis\":\"PerCurrencyUnit\",\"isNonPassThru\"\
+ :false}],\"nonPassthroughDetails\":[],\"hsCode\":\"\",\"costInsuranceFreight\"\
+ :0.0,\"vatCode\":\"PLS-2300F--US\",\"vatNumberTypeId\":0}],\"addresses\":[{\"\
+ id\":0,\"transactionId\":0,\"boundaryLevel\":\"Zip5\",\"line1\":\"T\u0119\
+ czowa 7\",\"line2\":\"\",\"line3\":\"\",\"city\":\"WROCLAW\",\"region\":\"\
+ \",\"postalCode\":\"53-601\",\"country\":\"PL\",\"taxRegionId\":205102,\"\
+ latitude\":\"0\",\"longitude\":\"0\"},{\"id\":0,\"transactionId\":0,\"boundaryLevel\"\
+ :\"Zip5\",\"line1\":\"2000 Main Street\",\"line2\":\"\",\"line3\":\"\",\"\
+ city\":\"Irvine\",\"region\":\"CA\",\"postalCode\":\"92614\",\"country\":\"\
+ US\",\"taxRegionId\":4017409,\"latitude\":\"0\",\"longitude\":\"0\"}],\"summary\"\
+ :[{\"country\":\"PL\",\"region\":\"PL\",\"jurisType\":\"Country\",\"jurisCode\"\
+ :\"PL\",\"jurisName\":\"POLAND\",\"taxAuthorityType\":45,\"stateAssignedNo\"\
+ :\"\",\"taxType\":\"Output\",\"taxSubType\":\"O\",\"taxName\":\"Standard Rate\"\
+ ,\"rateType\":\"Standard\",\"taxable\":20.33,\"rate\":0.230000,\"tax\":4.67,\"\
+ taxCalculated\":4.67,\"nonTaxable\":0.0,\"exemption\":0.0}]}"
+ headers:
+ Connection:
+ - keep-alive
+ Content-Type:
+ - application/json; charset=utf-8
+ Date:
+ - Tue, 23 Jul 2019 13:43:42 GMT
+ Location:
+ - /api/v2/companies/242975/transactions/0
+ ServerDuration:
+ - '00:00:00.0911840'
+ Transfer-Encoding:
+ - chunked
+ X-Content-Type-Options:
+ - nosniff
+ status:
+ code: 201
+ message: Created
+version: 1
diff --git a/tests/extensions/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml b/tests/extensions/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml
new file mode 100644
index 0000000000..90507f635b
--- /dev/null
+++ b/tests/extensions/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml
@@ -0,0 +1,51 @@
+interactions:
+- request:
+ body: '{"createTransactionModel": {"companyCode": "DEFAULT", "type": "SalesOrder",
+ "lines": [{"quantity": 3, "amount": "15.00", "taxCode": "O9999999", "taxIncluded":
+ true, "itemCode": "123", "description": ""}, {"quantity": 1, "amount": "10.00",
+ "taxCode": "FR020100", "taxIncluded": true, "itemCode": "Shipping", "description":
+ ""}], "code": "69a838ee-0c2e-4768-9f5d-ee4cb32a152e", "date": "2019-07-23",
+ "customerCode": 0, "addresses": {"shipFrom": {"line1": null, "line2": null,
+ "city": null, "region": null, "country": null, "postalCode": null}, "shipTo":
+ {"line1": "T\u0119czowa 7", "line2": "", "city": "WROC\u0141AW", "region": "",
+ "country": "PL", "postalCode": "53-601"}}, "commit": false, "currencyCode":
+ "USD", "email": ""}}'
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Authorization:
+ - Basic Tm9uZTpOb25l
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '727'
+ User-Agent:
+ - python-requests/2.22.0
+ method: POST
+ uri: https://sandbox-rest.avatax.com/api/v2/transactions/createoradjust
+ response:
+ body:
+ string: '{"error":{"code":"AuthenticationException","message":"Authentication
+ failed.","target":"HttpRequestHeaders","details":[{"code":"AuthenticationException","number":30,"message":"Authentication
+ failed.","description":"Unable to authenticate the user or the account.","faultCode":"Client","helpLink":"http://developer.avalara.com/avatax/errors/AuthenticationException","severity":"Exception"},{"code":"StringLengthError","number":13,"message":"Field
+ ''password'' has an invalid length.","description":"Field ''password'' must
+ be between 5 and 50 characters in length.","faultCode":"Client","helpLink":"http://developer.avalara.com/avatax/errors/StringLengthError","severity":"Error"}]}}'
+ headers:
+ Connection:
+ - keep-alive
+ Content-Type:
+ - application/json; charset=utf-8
+ Date:
+ - Tue, 23 Jul 2019 14:05:25 GMT
+ ServerDuration:
+ - '00:00:00.0009998'
+ Transfer-Encoding:
+ - chunked
+ X-Content-Type-Options:
+ - nosniff
+ status:
+ code: 401
+ message: Unauthorized
+version: 1