Fix test case for sending invitations by email

This commit is contained in:
Neil Martinsen-Burrell 2023-11-09 15:39:53 -06:00
parent ab35221724
commit a7804b35ea
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
2 changed files with 15 additions and 8 deletions

View file

@ -272,11 +272,12 @@ class TestLogins(TestCase):
# this is one of the email addresses in data/test_contacts.txt
output_stream = StringIO()
call_command("send_domain_invitations",
stdout=output_stream)
# also have to re-point the logging handlers to output_stream
with less_console_noise(output_stream):
call_command("send_domain_invitations", "testuser@gmail.com", stdout=output_stream)
# Check that we had the right numbers in our output
output = output_stream.getvalue()
print("Output:", output)
# should only be one domain we send email for
self.assertIn("Found 1 transition domains", output)
self.assertTrue("would send email to testuser@gmail.com", output)