@patch('open_connect.groups.tasks.send_system_message')
    def test_add_user_to_group_with_notification(self, mock):
        group = mommy.make(Group)
        subject = 'This is a subject'
        message = 'This is a message'

        add_user_to_group.delay(
            self.user.pk, group.pk, notification=(subject, message))
        self.assertIn(group, self.user.groups_joined)
        self.assertIn(self.user, group.get_members())

        mock.delay.assert_called_with(
            self.user.pk, 'This is a subject', 'This is a message'
        )
Test adding to a group with a notification
dataset/ETHPy150Open ofa/connect/open_connect/groups/tests/test_tasks.py/TestAddUserToGroup.test_add_user_to_group_with_notification