[minor] [tests] fix, tests will fail on the 5th of a month!

This commit is contained in:
Rushabh Mehta 2017-01-06 17:20:44 +05:30
parent 7b4bdffea2
commit 8b133ac087
2 changed files with 4 additions and 4 deletions

View File

@ -76,7 +76,7 @@ class TestSalarySlip(unittest.TestCase):
if getdate(nowdate()).day >= 15:
date_of_joining = getdate(add_days(nowdate(),-10))
relieving_date = getdate(add_days(nowdate(),-10))
elif getdate(nowdate()).day < 15 and getdate(nowdate()).day > 5:
elif getdate(nowdate()).day < 15 and getdate(nowdate()).day >= 5:
date_of_joining = getdate(add_days(nowdate(),-3))
relieving_date = getdate(add_days(nowdate(),-3))
elif getdate(nowdate()).day < 5 and not getdate(nowdate()).day == 1:

View File

@ -74,7 +74,7 @@ class Warehouse(NestedSet):
ac_doc.flags.ignore_mandatory = True
try:
ac_doc.insert()
msgprint(_("Account head {0} created").format(ac_doc.name))
msgprint(_("Account head {0} created").format(ac_doc.name), indicator='green', alert=True)
except frappe.DuplicateEntryError, e:
if not (e.args and e.args[0]=='Account'):
@ -193,9 +193,9 @@ class Warehouse(NestedSet):
existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock")
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
repost_stock_for_items = frappe.db.sql_list("""select distinct item_code
repost_stock_for_items = frappe.db.sql_list("""select distinct item_code
from tabBin where warehouse=%s""", newdn)
# Delete all existing bins to avoid duplicate bins for the same item and warehouse
frappe.db.sql("delete from `tabBin` where warehouse=%s", newdn)