fix: Test Cases
This commit is contained in:
parent
c765073c2a
commit
2ff0d3e0eb
@ -263,14 +263,6 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
})
|
})
|
||||||
pi.submit()
|
pi.submit()
|
||||||
|
|
||||||
# gle = frappe.get_all(
|
|
||||||
# "GL Entry",
|
|
||||||
# fields = ['account', 'debit', 'credit', 'posting_date'],
|
|
||||||
# filters = {'voucher_no': pi.name}
|
|
||||||
# )
|
|
||||||
# for gl in gle:
|
|
||||||
# print(gl, "\n")
|
|
||||||
|
|
||||||
expected_gle = [
|
expected_gle = [
|
||||||
["_Test Account Cost for Goods Sold - _TC", 100.0, 0.0, nowdate()],
|
["_Test Account Cost for Goods Sold - _TC", 100.0, 0.0, nowdate()],
|
||||||
["_Test Account VAT - _TC", 20.0, 0.0, nowdate()],
|
["_Test Account VAT - _TC", 20.0, 0.0, nowdate()],
|
||||||
@ -1196,7 +1188,6 @@ def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
|||||||
where voucher_type='Purchase Invoice' and voucher_no=%s and posting_date >= %s
|
where voucher_type='Purchase Invoice' and voucher_no=%s and posting_date >= %s
|
||||||
order by posting_date asc, account asc""", (voucher_no, posting_date), as_dict=1)
|
order by posting_date asc, account asc""", (voucher_no, posting_date), as_dict=1)
|
||||||
|
|
||||||
print(gl_entries)
|
|
||||||
for i, gle in enumerate(gl_entries):
|
for i, gle in enumerate(gl_entries):
|
||||||
doc.assertEqual(expected_gle[i][0], gle.account)
|
doc.assertEqual(expected_gle[i][0], gle.account)
|
||||||
doc.assertEqual(expected_gle[i][1], gle.debit)
|
doc.assertEqual(expected_gle[i][1], gle.debit)
|
||||||
|
|||||||
@ -2008,7 +2008,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
additional_discount_account = create_account(account_name="Discount Account",
|
additional_discount_account = create_account(account_name="Discount Account",
|
||||||
parent_account="Indirect Expenses - _TC", company="_Test Company")
|
parent_account="Indirect Expenses - _TC", company="_Test Company")
|
||||||
|
|
||||||
si = create_sales_invoice(rate=100, do_not_save=1)
|
si = create_sales_invoice(rate=100, parent_cost_center='Main - _TC', do_not_save=1)
|
||||||
si.apply_discount_on = "Grand Total"
|
si.apply_discount_on = "Grand Total"
|
||||||
si.additional_discount_account = additional_discount_account
|
si.additional_discount_account = additional_discount_account
|
||||||
si.additional_discount_percentage = 20
|
si.additional_discount_percentage = 20
|
||||||
@ -2016,7 +2016,6 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
"charge_type": "Actual",
|
"charge_type": "Actual",
|
||||||
"account_head": "_Test Account VAT - _TC",
|
"account_head": "_Test Account VAT - _TC",
|
||||||
"cost_center": "Main - _TC",
|
"cost_center": "Main - _TC",
|
||||||
"parent_cost_center": "Main - _TC",
|
|
||||||
"description": "Test",
|
"description": "Test",
|
||||||
"rate": 0,
|
"rate": 0,
|
||||||
"tax_amount": 20
|
"tax_amount": 20
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user