'Tests that when an inactive user logs-in using the social auth, system
sends an activation email to the user.'

@mock.patch('student.tasks.log')
def test_send_email_to_inactive_user(self, mock_log):

    inactive_user = UserFactory(is_active=False)
    Registration().register(inactive_user)
    request = RequestFactory().get(settings.SOCIAL_AUTH_INACTIVE_USER_URL)
    request.user = inactive_user
    with patch('edxmako.request_context.get_current_request'):
        inactive_user_view(request)
        mock_log.info.assert_called_with('Activation    Email    has    been    sent    to    User    {user_email}'.format(user_email=inactive_user.email))
