[test] fixes

This commit is contained in:
Rushabh Mehta 2015-10-15 11:00:34 +05:30
parent c4d4c7feb0
commit c9bacedbfe
2 changed files with 73 additions and 66 deletions

View File

@ -327,8 +327,10 @@ class TestDeliveryNote(unittest.TestCase):
def test_delivery_of_bundled_items_to_target_warehouse(self):
set_perpetual_inventory()
create_stock_reconciliation(item_code="_Test Item", target="_Test Warehouse - _TC", qty=50, rate=100)
create_stock_reconciliation(item_code="_Test Item Home Desktop 100", target="_Test Warehouse - _TC",
create_stock_reconciliation(item_code="_Test Item", target="_Test Warehouse - _TC",
qty=50, rate=100)
create_stock_reconciliation(item_code="_Test Item Home Desktop 100",
target="_Test Warehouse - _TC",
qty=50, rate=100)
opening_qty_test_warehouse_1 = get_qty_after_transaction(warehouse="_Test Warehouse 1 - _TC")
@ -352,6 +354,7 @@ class TestDeliveryNote(unittest.TestCase):
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)
# Check gl entries

View File

@ -10,6 +10,7 @@ from frappe.utils import flt, nowdate, nowtime
from erpnext.accounts.utils import get_fiscal_year, get_stock_and_account_difference
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.stock.stock_ledger import get_previous_sle, update_entries_after
from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import EmptyStockReconciliationItemsError
class TestStockReconciliation(unittest.TestCase):
def setUp(self):
@ -107,7 +108,10 @@ def create_stock_reconciliation(**args):
"valuation_rate": args.rate
})
sr.submit()
try:
sr.submit()
except EmptyStockReconciliationItemsError:
pass
return sr
def repost_stock_as_per_valuation_method(valuation_method):