Test case fixed for swtiching valuation method

This commit is contained in:
Nabin Hait 2015-10-19 14:46:36 +05:30
parent 608bbc7850
commit 6f64a78ecf
2 changed files with 18 additions and 3 deletions

View File

@ -352,6 +352,21 @@ class TestDeliveryNote(unittest.TestCase):
self.assertEquals(actual_qty, opening_qty_test_warehouse_1 + 25) self.assertEquals(actual_qty, opening_qty_test_warehouse_1 + 25)
# stock value diff for source warehouse # stock value diff for source warehouse
# for "_Test Item"
stock_value_difference = frappe.db.get_value("Stock Ledger Entry",
{"voucher_type": "Delivery Note", "voucher_no": dn.name,
"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"},
"stock_value_difference")
# stock value diff for target warehouse
stock_value_difference1 = frappe.db.get_value("Stock Ledger Entry",
{"voucher_type": "Delivery Note", "voucher_no": dn.name,
"item_code": "_Test Item", "warehouse": "_Test Warehouse 1 - _TC"},
"stock_value_difference")
self.assertEquals(abs(stock_value_difference), stock_value_difference1)
# for "_Test Item Home Desktop 100"
stock_value_difference = frappe.db.get_value("Stock Ledger Entry", stock_value_difference = frappe.db.get_value("Stock Ledger Entry",
{"voucher_type": "Delivery Note", "voucher_no": dn.name, {"voucher_type": "Delivery Note", "voucher_no": dn.name,
"item_code": "_Test Item Home Desktop 100", "warehouse": "_Test Warehouse - _TC"}, "item_code": "_Test Item Home Desktop 100", "warehouse": "_Test Warehouse - _TC"},

View File

@ -120,7 +120,7 @@ def set_valuation_method(item_code, valuation_method):
for warehouse in frappe.get_all("Warehouse", filters={"company": "_Test Company"}): for warehouse in frappe.get_all("Warehouse", filters={"company": "_Test Company"}):
update_entries_after({ update_entries_after({
"item_code": item_code, "item_code": item_code,
"warehouse": warehouse "warehouse": warehouse.name
}, allow_negative_stock=1) }, allow_negative_stock=1)
test_dependencies = ["Item", "Warehouse"] test_dependencies = ["Item", "Warehouse"]