From 48d068a75f92c723f983f7259c9939ceed11123b Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 19 Aug 2022 13:17:37 +0530 Subject: [PATCH] ci: fix broken tests due to regional separation (#196) * ci: fix broken tests due to regional separation * ci: get payments app * ci: reduce frequency for scheduled tests * chore: dev version * test: ignore india compliance fields --- .github/helper/install.sh | 1 + .github/workflows/ci.yml | 4 +-- ecommerce_integrations/__init__.py | 2 +- ecommerce_integrations/shopify/tests/utils.py | 4 --- .../unicommerce_channel/test_records.json | 20 +++++++------- .../unicommerce/tests/test_product.py | 1 - ecommerce_integrations/utils/before_test.py | 26 +++++++++++++++++++ 7 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 1c932467..4de50f53 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -31,6 +31,7 @@ sed -i 's/schedule:/# schedule:/g' Procfile sed -i 's/socketio:/# socketio:/g' Procfile sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile +bench get-app payments --branch develop bench get-app erpnext --branch develop bench start & diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a25a82cc..defef100 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,8 @@ on: - develop - main schedule: - # Run everday at midnight UTC / 5:30 IST - - cron: "0 0 * * *" + # Run every sunday at midnight UTC / 5:30 IST + - cron: "0 0 * * 0" concurrency: group: develop-${{ github.event.number }} diff --git a/ecommerce_integrations/__init__.py b/ecommerce_integrations/__init__.py index 5becc17c..eb436f1c 100644 --- a/ecommerce_integrations/__init__.py +++ b/ecommerce_integrations/__init__.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "2.0.0-dev" diff --git a/ecommerce_integrations/shopify/tests/utils.py b/ecommerce_integrations/shopify/tests/utils.py index 10d00da2..fd4f075c 100644 --- a/ecommerce_integrations/shopify/tests/utils.py +++ b/ecommerce_integrations/shopify/tests/utils.py @@ -65,10 +65,6 @@ def setUpClass(cls): "update_shopify_item_on_update": 1, "update_erpnext_stock_levels_to_shopify": 1, "doctype": "Shopify Setting", - "taxes": [ - {"shopify_tax": "IGST", "tax_account": "Output Tax IGST - _TC",}, - {"shopify_tax": "Standard", "tax_account": "Freight and Forwarding Charges - _TC",}, - ], "shopify_warehouse_mapping": [ { "shopify_location_id": "62279942297", diff --git a/ecommerce_integrations/unicommerce/doctype/unicommerce_channel/test_records.json b/ecommerce_integrations/unicommerce/doctype/unicommerce_channel/test_records.json index 4fd83dc3..de04da30 100644 --- a/ecommerce_integrations/unicommerce/doctype/unicommerce_channel/test_records.json +++ b/ecommerce_integrations/unicommerce/doctype/unicommerce_channel/test_records.json @@ -10,11 +10,11 @@ "customer_group": "Individual", "fnf_account": "Freight and Forwarding Charges - WP", "cod_account": "Freight and Forwarding Charges - WP", - "igst_account": "Output Tax IGST - WP", - "cgst_account": "Output Tax CGST - WP", - "sgst_account": "Output Tax SGST - WP", - "ugst_account": "Output Tax SGST - WP", - "tcs_account": "Output Tax SGST - WP", + "igst_account": "Output Tax GST - WP", + "cgst_account": "Output Tax GST - WP", + "sgst_account": "Output Tax GST - WP", + "ugst_account": "Output Tax GST - WP", + "tcs_account": "Output Tax GST - WP", "cost_center": "Main - WP", "cash_or_bank_account": "Cash - WP", "gift_wrap_account": "Miscellaneous Expenses - WP", @@ -31,11 +31,11 @@ "customer_group": "Individual", "fnf_account": "Freight and Forwarding Charges - WP", "cod_account": "Freight and Forwarding Charges - WP", - "igst_account": "Output Tax IGST - WP", - "cgst_account": "Output Tax CGST - WP", - "sgst_account": "Output Tax SGST - WP", - "ugst_account": "Output Tax SGST - WP", - "tcs_account": "Output Tax SGST - WP", + "igst_account": "Output Tax GST - WP", + "cgst_account": "Output Tax GST - WP", + "sgst_account": "Output Tax GST - WP", + "ugst_account": "Output Tax GST - WP", + "tcs_account": "Output Tax GST - WP", "cost_center": "Main - WP", "cash_or_bank_account": "Cash - WP", "gift_wrap_account": "Miscellaneous Expenses - WP" diff --git a/ecommerce_integrations/unicommerce/tests/test_product.py b/ecommerce_integrations/unicommerce/tests/test_product.py index 836d1b7e..96c72e5b 100644 --- a/ecommerce_integrations/unicommerce/tests/test_product.py +++ b/ecommerce_integrations/unicommerce/tests/test_product.py @@ -56,7 +56,6 @@ def test_import_item_from_unicommerce(self): "brand": "TITANIUM", "shelf_life_in_days": 0, "disabled": 0, - "gst_hsn_code": "91011100", "image": "https://user-images.githubusercontent.com/9079960/131f-650c52c07a0e.gif", } for field, value in expected_item.items(): diff --git a/ecommerce_integrations/utils/before_test.py b/ecommerce_integrations/utils/before_test.py index d7f069f7..0622afa6 100644 --- a/ecommerce_integrations/utils/before_test.py +++ b/ecommerce_integrations/utils/before_test.py @@ -32,5 +32,31 @@ def before_tests(): frappe.db.set_value("Stock Settings", None, "auto_insert_price_list_rate_if_missing", 0) enable_all_roles_and_domains() + create_tax_account() frappe.db.commit() + + +def create_tax_account(): + company = "Wind Power LLC" + account_name = "Output Tax GST" + + parent = ( + frappe.db.get_value("Account", {"company": company, "account_type": "Tax", "is_group": 1}) + or "Duties and Taxes - WP" + ) + + frappe.get_doc( + { + "doctype": "Account", + "account_name": account_name, + "is_group": 0, + "company": company, + "root_type": "Liability", + "report_type": "Balance Sheet", + "account_currency": "INR", + "parent_account": parent, + "account_type": "Tax", + "tax_rate": 18, + } + ).insert()