Skip to content

Commit

Permalink
test: fix failing test cases related to UOM validation in ERPNext (#1938
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Abdeali099 authored Mar 29, 2024
1 parent 8b8ea42 commit 48b110a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion india_compliance/gst_india/overrides/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,11 @@ def test_missing_hsn_code(self):
"item_code": "_Test Item Without HSN",
"item_name": "_Test Item Without HSN",
"valuation_rate": 100,
"is_sales_item": 0,
},
)
item_without_hsn.flags.ignore_validate = True
item_without_hsn.insert()
item_without_hsn.db_set("is_sales_item", 1)

# create transaction
doc = create_transaction(
Expand Down
11 changes: 3 additions & 8 deletions india_compliance/gst_india/utils/test_e_waybill.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def test_get_all_item_details(self):
- check if item details are generated correctly
"""
si = create_sales_invoice(do_not_submit=True)
item_code = si.items[0].item_code

hsn_codes = frappe.get_file_json(
frappe.get_app_path(
Expand All @@ -321,7 +322,7 @@ def test_get_all_item_details(self):
append_item(
si,
frappe._dict(
item_code=hsn_code,
item_code=item_code,
item_name="Test Item {}".format(i),
rate=100,
gst_hsn_code=hsn_code,
Expand All @@ -337,13 +338,7 @@ def test_get_all_item_details(self):
)

# Assert get_all_item_details
to_remove = [
d
for d in si.items
if d.gst_hsn_code != "61149090" and d.item_code != "_Test Trading Goods 1"
]
for item in to_remove:
si.remove(item)
si.items = si.items[:1]
si.save()

self.assertListEqual(
Expand Down

0 comments on commit 48b110a

Please sign in to comment.