def test_simple(self): user = self.create_user(email='*****@*****.**') organization = self.create_organization(owner=user, name='Test') AuthProvider.objects.create( organization=organization, provider='dummy', ) OrganizationMember.objects.create_or_update( user=user, organization=organization, values={ 'flags': getattr(OrganizationMember.flags, 'sso:linked'), }, ) user2 = self.create_user(email='*****@*****.**') OrganizationMember.objects.create( user=user2, organization=organization, flags=0, ) with self.tasks(): email_missing_links(organization.id) assert len(mail.outbox) == 1 assert mail.outbox[0].to == [user2.email]
def test_email_missing_links(self): with self.tasks(): email_missing_links(self.organization.id, self.user.id, self.provider.provider) assert len(mail.outbox) == 1 assert mail.outbox[0].to == [self.user2.email]