def test_custom_login_action(self):
        self.client.login(username='authorized', password='pass')

        flag = { 'called': False }
        def custom_action(request, user):
            flag['called'] = True

        with self.settings(SU_CUSTOM_LOGIN_ACTION=custom_action):
            response = self.client.post(
                reverse('login_as_user', args=[self.destination_user.id])
            )
        self.assertTrue(flag['called'])
Ensure custom login action is called
dataset/ETHPy150Open adamcharnock/django-su/django_su/tests/test_views.py/LoginAsUserViewTestCase.test_custom_login_action