From 39523916d416dba9a7d3c5402435365304ea030f Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Wed, 23 Apr 2025 14:53:56 +0530 Subject: [PATCH 1/4] fix: don't create example email domains and email accounts Signed-off-by: Akhil Narang --- .../page/setup_wizard/install_fixtures.py | 7 ------- frappe/utils/install.py | 21 ------------------- 2 files changed, 28 deletions(-) diff --git a/frappe/desk/page/setup_wizard/install_fixtures.py b/frappe/desk/page/setup_wizard/install_fixtures.py index 7115573e0b..60c832b78a 100644 --- a/frappe/desk/page/setup_wizard/install_fixtures.py +++ b/frappe/desk/page/setup_wizard/install_fixtures.py @@ -19,7 +19,6 @@ def install(): update_genders() update_salutations() update_global_search_doctypes() - setup_email_linking() sync_dashboards() add_unsubscribe() @@ -56,12 +55,6 @@ def update_salutations(): doc.insert(ignore_permissions=True, ignore_if_duplicate=True) -def setup_email_linking(): - doc = frappe.new_doc("Email Account") - doc.email_id = "email_linking@example.com" - doc.insert(ignore_permissions=True, ignore_if_duplicate=True) - - def add_unsubscribe(): for unsubscribe in [ {"email": "admin@example.com", "global_unsubscribe": 1}, diff --git a/frappe/utils/install.py b/frappe/utils/install.py index 195e9a4c0a..32856bc8fa 100644 --- a/frappe/utils/install.py +++ b/frappe/utils/install.py @@ -112,27 +112,6 @@ def install_basic_docs(): {"doctype": "Workflow Action Master", "workflow_action_name": "Approve"}, {"doctype": "Workflow Action Master", "workflow_action_name": "Reject"}, {"doctype": "Workflow Action Master", "workflow_action_name": "Review"}, - { - "doctype": "Email Domain", - "domain_name": "example.com", - "email_id": "account@example.com", - "password": "pass", - "email_server": "imap.example.com", - "use_imap": 1, - "smtp_server": "smtp.example.com", - }, - { - "doctype": "Email Account", - "domain": "example.com", - "email_id": "notifications@example.com", - "default_outgoing": 1, - }, - { - "doctype": "Email Account", - "domain": "example.com", - "email_id": "replies@example.com", - "default_incoming": 1, - }, ] for d in install_docs: From fe63c5d677b4958b2ce6409c291bd085d981b0ac Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Wed, 23 Apr 2025 16:49:39 +0530 Subject: [PATCH 2/4] fix(tests): create `example.com` email_domain record for test email_account tests rely on this Signed-off-by: Akhil Narang --- frappe/email/doctype/email_domain/test_records.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frappe/email/doctype/email_domain/test_records.json b/frappe/email/doctype/email_domain/test_records.json index a6ccc99f06..41c469d105 100644 --- a/frappe/email/doctype/email_domain/test_records.json +++ b/frappe/email/doctype/email_domain/test_records.json @@ -28,5 +28,14 @@ "smtp_server": "smtp.test.com", "smtp_port": "587", "password": "password" + }, + { + "doctype": "Email Domain", + "domain_name": "example.com", + "email_id": "account@example.com", + "password": "pass", + "email_server": "imap.example.com", + "use_imap": 1, + "smtp_server": "smtp.example.com" } ] From e5487e7403e4cafbaf66658f86cd400a678bd59a Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Wed, 23 Apr 2025 17:07:11 +0530 Subject: [PATCH 3/4] chore: drop email linking patch Signed-off-by: Akhil Narang --- frappe/patches.txt | 1 - frappe/patches/v12_0/setup_email_linking.py | 5 ----- 2 files changed, 6 deletions(-) delete mode 100644 frappe/patches/v12_0/setup_email_linking.py diff --git a/frappe/patches.txt b/frappe/patches.txt index b56a5173f0..58f1466d94 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -103,7 +103,6 @@ frappe.patches.v12_0.setup_tags frappe.patches.v12_0.update_auto_repeat_status_and_not_submittable frappe.patches.v12_0.create_notification_settings_for_user frappe.patches.v11_0.make_all_prepared_report_attachments_private #2019-11-26 -frappe.patches.v12_0.setup_email_linking frappe.patches.v12_0.change_existing_dashboard_chart_filters frappe.patches.v12_0.set_correct_assign_value_in_docs #2020-07-13 execute:frappe.delete_doc('DocType', 'Test Runner') # 2022-05-19 diff --git a/frappe/patches/v12_0/setup_email_linking.py b/frappe/patches/v12_0/setup_email_linking.py deleted file mode 100644 index 56166f89dc..0000000000 --- a/frappe/patches/v12_0/setup_email_linking.py +++ /dev/null @@ -1,5 +0,0 @@ -from frappe.desk.page.setup_wizard.install_fixtures import setup_email_linking - - -def execute(): - setup_email_linking() From 309c18cabb2c11e6b4ae679e187eaba79f843042 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Wed, 23 Apr 2025 17:54:43 +0530 Subject: [PATCH 4/4] fix(ui_tests): create email account Signed-off-by: Akhil Narang --- frappe/tests/ui_test_helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/tests/ui_test_helpers.py b/frappe/tests/ui_test_helpers.py index 24fb28e561..c386e65605 100644 --- a/frappe/tests/ui_test_helpers.py +++ b/frappe/tests/ui_test_helpers.py @@ -499,6 +499,9 @@ def setup_image_doctype(): @whitelist_for_tests def setup_inbox(): frappe.db.delete("User Email") + doc = frappe.new_doc("Email Account") + doc.email_id = "email_linking@example.com" + doc.insert(ignore_permissions=True, ignore_if_duplicate=True) user = frappe.get_doc("User", frappe.session.user) user.append("user_emails", {"email_account": "Email Linking"})