Send invitation emails

ref #19
This commit is contained in:
Tobias Kunze 2025-10-08 17:53:27 +02:00
parent 21c26f9e5d
commit b9ff0e61da
5 changed files with 119 additions and 40 deletions

View file

@ -73,12 +73,8 @@ def test_successful_onboarding_new_organization(
assert org.origin == exoscale_origin
assert org.namespace.startswith("org-")
user = User.objects.get(email="test@example.com")
assert user.first_name == "Test"
assert user.last_name == "User"
with scopes_disabled():
membership = org.memberships.get(user=user)
assert membership.role == "owner"
assert org.invitations.all().filter(email="test@example.com").exists()
billing_entity = org.billing_entity
assert billing_entity.name == "Test Organization Display (Exoscale)"
@ -91,7 +87,10 @@ def test_successful_onboarding_new_organization(
assert len(mail.outbox) == 2
invitation_email = mail.outbox[0]
assert invitation_email.subject == "Welcome to Servala - Test Organization Display"
assert (
invitation_email.subject
== "You're invited to join Test Organization Display on Servala"
)
assert "test@example.com" in invitation_email.to
welcome_email = mail.outbox[1]