Merge pull request #16119 from ankush/test_email_dom
test: fix flaky email domain test
This commit is contained in:
commit
13eab84189
1 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue