add sql query to set valid_till

This commit is contained in:
0Pranav 2019-11-25 12:55:27 +05:30
parent a077795581
commit a9ff7df2e6

View File

@ -217,7 +217,13 @@ class TestQuotation(unittest.TestCase):
}
]
yesterday = getdate(nowdate()) - datetime.timedelta(days=1)
expired_quotation = make_quotation(item_list=quotation_item,transaction_date=yesterday)
expired_quotation = make_quotation(item_list=quotation_item)
# Manually set valid till date to bypass validation
frappe.db.sql("""
UPDATE tabQuotation
SET valid_till = %s
WHERE name = %s
""",(yesterday,expired_quotation.name))
set_expired_status()
self.assertEqual(expired_quotation.status,"Expired")