From a9ff7df2e6b81a5f824c566c4649db2d43517ba8 Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Mon, 25 Nov 2019 12:55:27 +0530 Subject: [PATCH] add sql query to set valid_till --- erpnext/selling/doctype/quotation/test_quotation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 2aefe3a0d3..aab5fd783a 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -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")