def myhandler(sender, action, request, queryset, **kwargs): myhandler.invoked = True self.assertEqual(action, self.action_name) self.assertSequenceEqual( queryset.order_by('id').values_list('id', flat=True), sorted(self._selected_values)) raise ActionInterrupted(self.MESSAGE)
def _handler(*args, **kwargs): raise ActionInterrupted()
def myhandler(sender, action, request, queryset, form, **kwargs): myhandler.invoked = True self.assertEqual(action, self.action_name) self.assertSequenceEqual(queryset.order_by('id').values_list('id', flat=True), self.selected_rows) self.assertTrue(isinstance(form, BaseForm)) raise ActionInterrupted(self.MESSAGE)