From 0035772f8fb7b7cd72af7bbde6b1099299554cb4 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 24 Sep 2019 21:45:48 +0530 Subject: [PATCH] fix(tests) --- frappe/core/doctype/version/version.py | 2 +- frappe/database/postgres/framework_postgres.sql | 12 ++++++------ .../email/doctype/notification/test_notification.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frappe/core/doctype/version/version.py b/frappe/core/doctype/version/version.py index cb891afa0c..05cc102ab9 100644 --- a/frappe/core/doctype/version/version.py +++ b/frappe/core/doctype/version/version.py @@ -50,7 +50,7 @@ def get_diff(old, new, for_child=False): if df.fieldtype in no_value_fields and df.fieldtype not in table_fields: continue - old_value, new_value = old.get(df.fieldname) or [], new.get(df.fieldname) or [] + old_value, new_value = old.get(df.fieldname), new.get(df.fieldname) if df.fieldtype in table_fields: # make maps diff --git a/frappe/database/postgres/framework_postgres.sql b/frappe/database/postgres/framework_postgres.sql index e49b461518..373a55279b 100644 --- a/frappe/database/postgres/framework_postgres.sql +++ b/frappe/database/postgres/framework_postgres.sql @@ -122,10 +122,10 @@ CREATE TABLE "tabDocType Action" ( "parentfield" varchar(255) DEFAULT NULL, "parenttype" varchar(255) DEFAULT NULL, "idx" bigint NOT NULL DEFAULT 0, - "label" varchar(140) DEFAULT NOT NULL, + "label" varchar(140) NOT NULL, "group" varchar(140) DEFAULT NULL, - "action_type" varchar(140) DEFAULT NOT NULL, - "action" varchar(140) DEFAULT NOT NULL, + "action_type" varchar(140) NOT NULL, + "action" varchar(140) NOT NULL, PRIMARY KEY ("name") ) ; @@ -147,10 +147,10 @@ CREATE TABLE "tabDocType Link" ( "parentfield" varchar(255) DEFAULT NULL, "parenttype" varchar(255) DEFAULT NULL, "idx" bigint NOT NULL DEFAULT 0, - "label" varchar(140) DEFAULT NOT NULL, + "label" varchar(140) NOT NULL, "group" varchar(140) DEFAULT NULL, - "link_doctype" varchar(140) DEFAULT NOT NULL, - "link_fieldname" varchar(140) DEFAULT NOT NULL, + "link_doctype" varchar(140) NOT NULL, + "link_fieldname" varchar(140) NOT NULL, PRIMARY KEY ("name") ) ; diff --git a/frappe/email/doctype/notification/test_notification.py b/frappe/email/doctype/notification/test_notification.py index 4d3c3167a5..b9bbde172d 100644 --- a/frappe/email/doctype/notification/test_notification.py +++ b/frappe/email/doctype/notification/test_notification.py @@ -136,7 +136,7 @@ class TestNotification(unittest.TestCase): "reference_name": event.name, "status": "Not Sent"})) frappe.set_user('Administrator') - frappe.utils.scheduler.trigger(frappe.local.site, "daily", now=True) + frappe.get_doc('Scheduled Job Type', dict(method='frappe.email.doctype.notification.notification.trigger_daily_alerts')).execute() # not today, so no alert self.assertFalse(frappe.db.get_value("Email Queue", {"reference_doctype": "Event", @@ -150,7 +150,7 @@ class TestNotification(unittest.TestCase): self.assertFalse(frappe.db.get_value("Email Queue", {"reference_doctype": "Event", "reference_name": event.name, "status": "Not Sent"})) - frappe.utils.scheduler.trigger(frappe.local.site, "daily", now=True) + frappe.get_doc('Scheduled Job Type', dict(method='frappe.email.doctype.notification.notification.trigger_daily_alerts')).execute() # today so show alert self.assertTrue(frappe.db.get_value("Email Queue", {"reference_doctype": "Event",