Merge pull request #16119 from ankush/test_email_dom

test: fix flaky email domain test
This commit is contained in:
Ankush Menat 2022-02-24 11:40:43 +05:30 committed by GitHub
commit 13eab84189
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,11 +20,13 @@ class TestDomain(unittest.TestCase):
mail_domain = frappe.get_doc("Email Domain", "test.com")
mail_account = frappe.get_doc("Email Account", "Test")
# Initially, incoming_port is different in domain and account
self.assertNotEqual(mail_account.incoming_port, mail_domain.incoming_port)
# Ensure a different port
mail_account.incoming_port = int(mail_domain.incoming_port) + 5
mail_account.save()
# Trigger update of accounts using this domain
mail_domain.on_update()
mail_account = frappe.get_doc("Email Account", "Test")
mail_account.reload()
# After update, incoming_port in account should match the domain
self.assertEqual(mail_account.incoming_port, mail_domain.incoming_port)