test: skip invite email if in test

This commit is contained in:
Jannat Patel
2023-11-06 19:08:30 +05:30
parent de9cb935ee
commit 929f97cb72

View File

@@ -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):