fix: Test Cases

This commit is contained in:
Deepesh Garg 2021-07-05 17:08:27 +05:30
parent 15b336df28
commit 9b6d9a41f4
3 changed files with 8 additions and 2 deletions

View File

@ -204,6 +204,7 @@ def create_mpesa_settings(payment_gateway_name="Express"):
doc = frappe.get_doc(dict( #nosec
doctype="Mpesa Settings",
sandbox=1,
payment_gateway_name=payment_gateway_name,
consumer_key="5sMu9LVI1oS3oBGPJfh3JyvLHwZOdTKn",
consumer_secret="VI1oS3oBGPJfh3JyvLHw",

View File

@ -83,7 +83,7 @@ class TestExpenseClaim(unittest.TestCase):
self.assertTrue(gl_entries)
expected_values = dict((d[0], d) for d in [
['CGST - _TC4',18.0, 0.0],
['Output Tax CGST - _TC4',18.0, 0.0],
[payable_account, 0.0, 218.0],
["Travel Expenses - _TC4", 200.0, 0.0]
])

View File

@ -449,6 +449,8 @@ def install_defaults(args=None):
set_active_domains(args)
update_stock_settings()
update_shopping_cart_settings(args)
args.update({"set_default": 1})
create_bank_account(args)
def set_global_defaults(args):
@ -499,8 +501,11 @@ def create_bank_account(args):
try:
doc = bank_account.insert()
if args.get('set_default'):
frappe.db.set_value("Company", args.get('company_name'), "default_bank_account", bank_account.name, update_modified=False)
return doc
except RootNotEditable:
frappe.throw(_("Bank account cannot be named as {0}").format(args.get('bank_account')))
except frappe.DuplicateEntryError: