def test_invite_new_users(self):
        users = ['newuser1@example.com', 'newuser2@example.com']

        self.assertFalse(
            Invite.objects.filter(email='newuser1@example.com').exists())
        self.assertFalse(
            Invite.objects.filter(email='newuser2@example.com').exists())

        invite_users_to_group(users, self.user1.pk, self.newgroup.pk)
        self.assertEqual(self.mockemailinvite.delay.call_count, 2)

        self.assertTrue(Invite.objects.filter(
            email='newuser1@example.com',
            groups__in=[self.newgroup],
            created_by=self.user1
        ).exists())
        self.assertTrue(Invite.objects.filter(
            email='newuser2@example.com',
            groups__in=[self.newgroup],
            created_by=self.user1
        ).exists())
Test 2 invites are created for users that aren't already invited
dataset/ETHPy150Open ofa/connect/open_connect/groups/tests/test_tasks.py/InviteUsersToGroupTest.test_invite_new_users