diff --git a/lms/fixtures/custom_field.json b/lms/fixtures/custom_field.json index cdb50dba..1d8f17da 100644 --- a/lms/fixtures/custom_field.json +++ b/lms/fixtures/custom_field.json @@ -138,12 +138,12 @@ "label": "User Category", "length": 0, "mandatory_depends_on": null, - "modified": "2022-04-19 13:02:18.219508", + "modified": "2022-04-19 13:02:18.219510", "module": "LMS", "name": "User-user_category", "no_copy": 0, "non_negative": 0, - "options": "Business Owner\nManager (Sales/Marketing/Customer)\nEmployee\nStudent\nFreelancer/Just looking\nOthers", + "options": "\nBusiness Owner\nManager (Sales/Marketing/Customer)\nEmployee\nStudent\nFreelancer/Just looking\nOthers", "permlevel": 0, "precision": "", "print_hide": 0, diff --git a/lms/lms/doctype/invite_request/invite_request.py b/lms/lms/doctype/invite_request/invite_request.py index 7848529c..6a1d335b 100644 --- a/lms/lms/doctype/invite_request/invite_request.py +++ b/lms/lms/doctype/invite_request/invite_request.py @@ -11,7 +11,11 @@ from frappe.utils.password import get_decrypted_password class InviteRequest(Document): def on_update(self): - if self.has_value_changed("status") and self.status == "Approved": + if ( + self.has_value_changed("status") + and self.status == "Approved" + and not frappe.flags.in_test + ): self.send_email() def create_user(self, password): diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.py b/lms/lms/doctype/lms_certificate/lms_certificate.py index 1ffe1f10..f7e1193e 100644 --- a/lms/lms/doctype/lms_certificate/lms_certificate.py +++ b/lms/lms/doctype/lms_certificate/lms_certificate.py @@ -14,7 +14,8 @@ class LMSCertificate(Document): self.validate_duplicate_certificate() def after_insert(self): - self.send_mail() + if not frappe.flags.in_test: + self.send_mail() def send_mail(self): subject = _("Congratulations on getting certified!")