Send domain invitations to particular email addresses, tests don't work

This commit is contained in:
Neil Martinsen-Burrell 2023-11-08 12:11:20 -06:00
parent 3eef418ff8
commit ab35221724
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
2 changed files with 39 additions and 4 deletions

View file

@ -1,3 +1,5 @@
from io import StringIO
from django.test import TestCase
from registrar.models import (
@ -11,6 +13,8 @@ from registrar.models import (
from django.core.management import call_command
from .common import less_console_noise
class TestLogins(TestCase):
@ -259,3 +263,20 @@ class TestLogins(TestCase):
expected_missing_domain_informations,
expected_missing_domain_invitations,
)
def test_send_domain_invitations_email(self):
"""Can send only a single domain invitation email."""
with less_console_noise():
self.run_load_domains()
self.run_transfer_domains()
# this is one of the email addresses in data/test_contacts.txt
output_stream = StringIO()
call_command("send_domain_invitations",
stdout=output_stream)
# Check that we had the right numbers in our output
output = output_stream.getvalue()
print("Output:", output)
self.assertIn("Found 1 transition domains", output)
self.assertTrue("would send email to testuser@gmail.com", output)