fixes in Test Cases
This commit is contained in:
parent
349461e9e6
commit
01720404db
@ -364,8 +364,6 @@ class PurchaseInvoice(BuyingController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if gl_entries:
|
if gl_entries:
|
||||||
for d in gl_entries:
|
|
||||||
print d.account, d.debit, d.credit
|
|
||||||
from erpnext.accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
make_gl_entries(gl_entries, cancel=(self.docstatus == 2))
|
make_gl_entries(gl_entries, cancel=(self.docstatus == 2))
|
||||||
|
|
||||||
|
@ -246,13 +246,15 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
"rate": 500,
|
"rate": 500,
|
||||||
"qty": 1,
|
"qty": 1,
|
||||||
"item_code": "_Test Item Home Desktop 100",
|
"item_code": "_Test Item Home Desktop 100",
|
||||||
"expense_account": "_Test Account Cost for Goods Sold - _TC"
|
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"rate": 1500,
|
"rate": 1500,
|
||||||
"qty": 1,
|
"qty": 1,
|
||||||
"item_code": "_Test Item Home Desktop 200",
|
"item_code": "_Test Item Home Desktop 200",
|
||||||
"expense_account": "_Test Account Cost for Goods Sold - _TC"
|
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
||||||
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -260,6 +262,15 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
purchase_invoice.submit()
|
purchase_invoice.submit()
|
||||||
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), 2000)
|
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), 2000)
|
||||||
|
|
||||||
|
purchase_invoice1 = frappe.copy_doc(purchase_invoice)
|
||||||
|
purchase_invoice1.save()
|
||||||
|
purchase_invoice1.submit()
|
||||||
|
|
||||||
|
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), 4000)
|
||||||
|
|
||||||
|
purchase_invoice1.cancel()
|
||||||
|
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), 2000)
|
||||||
|
|
||||||
purchase_invoice.cancel()
|
purchase_invoice.cancel()
|
||||||
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), 0)
|
self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), 0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user