Optimise check

This commit is contained in:
Christopher Broderick 2025-05-10 13:16:35 +01:00
parent c713e3ea16
commit a3c563e104

View File

@ -511,11 +511,7 @@ class EmailInteractionsTestCase(TestCase):
)
# Check that the CC duplicate was still sent a notification email
email_count = len(mail.outbox)
found = False
for i in range(0, email_count - 1):
if dup_email in mail.outbox[i].to:
found = True
break
found = any(dup_email in email.to for email in mail.outbox[:email_count - 1])
self.assertTrue(
found, "The duplicated email across user ID's was not sent a notification."
)