Test case fixed for multi-currency and multi-uom BOM (#10679)

This commit is contained in:
Nabin Hait 2017-09-05 15:16:32 +05:30 committed by Rushabh Mehta
parent c929e88b97
commit 499fbe90dc
2 changed files with 6 additions and 2 deletions

View File

@ -93,6 +93,8 @@ class TestBOM(unittest.TestCase):
def test_bom_cost_multi_uom_multi_currency(self):
for item_code, rate in (("_Test Item", 3600), ("_Test Item Home Desktop Manufactured", 3000)):
frappe.db.sql("delete from `tabItem Price` where price_list='_Test Price List' and item_code=%s",
item_code)
item_price = frappe.new_doc("Item Price")
item_price.price_list = "_Test Price List"
item_price.item_code = item_code
@ -100,6 +102,7 @@ class TestBOM(unittest.TestCase):
item_price.insert()
bom = frappe.copy_doc(test_records[2])
bom.set_rate_of_sub_assembly_item_based_on_bom = 0
bom.rm_cost_as_per = "Price List"
bom.buying_price_list = "_Test Price List"
bom.items[0].uom = "_Test UOM 1"

View File

@ -92,7 +92,8 @@ class TestProductionOrder(unittest.TestCase):
self.assertEqual(prod_order.name, time_sheet_doc.production_order)
self.assertEqual((prod_order.qty - d.completed_qty), sum([d.completed_qty for d in time_sheet_doc.time_logs]))
self.assertEqual((prod_order.qty - d.completed_qty),
sum([d.completed_qty for d in time_sheet_doc.time_logs]))
manufacturing_settings = frappe.get_doc({
"doctype": "Manufacturing Settings",
@ -106,7 +107,7 @@ class TestProductionOrder(unittest.TestCase):
self.assertEqual(prod_order.operations[0].completed_qty, prod_order.qty)
self.assertEqual(prod_order.operations[0].actual_operation_time, 60)
self.assertEqual(prod_order.operations[0].actual_operating_cost, 100)
self.assertEqual(prod_order.operations[0].actual_operating_cost, 6000)
time_sheet_doc1 = make_timesheet(prod_order.name, prod_order.company)
self.assertEqual(len(time_sheet_doc1.get('time_logs')), 0)