call commit after sql query for schedular job
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index ac2c242..66ad215 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -187,7 +187,8 @@
 
 def set_expired_status():
 	frappe.db.sql("""UPDATE `tabQuotation` SET status = 'Expired' 
-		WHERE status != 'Expired' AND 'valid_till' < %s""", (nowdate()) )
+		WHERE status != 'Expired' AND 'valid_till' < %s""", (nowdate()))
+	frappe.db.commit()
 
 @frappe.whitelist()
 def make_sales_invoice(source_name, target_doc=None):
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index 1713556..2aefe3a 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -216,7 +216,7 @@
 				"rate": 500
 			}
 		]
-		yesterday = getdate(nowdate()) + datetime.timedelta(days=-1)
+		yesterday = getdate(nowdate()) - datetime.timedelta(days=1)
 		expired_quotation = make_quotation(item_list=quotation_item,transaction_date=yesterday)
 		set_expired_status()