def METHOD_NAME(self):
    self._send_user_to_es(username='superman')
    self._send_user_to_es(username='robin', user_data={'login_as_user': 'batman and robin'})
    with patch('corehq.apps.cloudcare.esaccessors._limit_login_as', return_value=True):
        self.assertEqual(
            login_as_user_query(
                self.domain,
                MagicMock(username='batman'),
                None,
                10,
                0
            ).values_list("username", flat=True),
            ["robin"]
        )