tests: fix issue tests
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index 91333b6..4c64a5a 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -253,11 +253,9 @@
doc = frappe.get_doc("Issue", issue.name)
if not doc.first_responded_on:
variance = round(time_diff_in_hours(doc.response_by, now_datetime()), 2)
- print(variance)
frappe.db.set_value("Issue", doc.name, "response_by_variance", variance)
if not doc.resolution_date:
variance = round(time_diff_in_hours(doc.resolution_by, now_datetime()), 2)
- print(variance)
frappe.db.set_value("Issue", doc.name, "resolution_by_variance", variance)
def get_list_context(context=None):
diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py
index 876aaf5..064ac68 100644
--- a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py
+++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py
@@ -14,13 +14,13 @@
if frappe.db.exists("Service Level Agreement", {"default_service_level_agreement": "1", "name": ["!=", self.name]}):
frappe.throw(_("A Default Service Level Agreement already exists."))
else:
- if not (self.start_date and self.end_date and self.ignore_start_and_end_date):
+ if not (self.start_date and self.end_date) and self.ignore_start_and_end_date:
frappe.throw(_("Enter Start and End Date for the Agreement."))
- if self.start_date >= self.end_date and not self.ignore_start_and_end_date:
+ if self.start_date >= self.end_date and self.ignore_start_and_end_date:
frappe.throw(_("Start Date of Agreement can't be greater than or equal to End Date."))
- if self.end_date < frappe.utils.nowdate() and not self.ignore_start_and_end_date:
+ if self.end_date < frappe.utils.getdate() and self.ignore_start_and_end_date:
frappe.throw(_("End Date of Agreement can't be less than today."))
def check_agreement_status():