def clear_roles(self, user, assignee):
        try:
            p_as_user = Participant.objects.get(workflowactivity=self, 
                        user=user, disabled=False)
            p_as_assignee = Participant.objects.get(workflowactivity=self, 
                    user=assignee)
            p_as_assignee.roles.clear()
            name = assignee.get_full_name() if assignee.get_full_name() else assignee.username
            note = _('All roles removed from %s')%name
            current_state = self.current_state().state if self.current_state() else None
            deadline = self.current_state().deadline if self.current_state() else None
            wh = WorkflowHistory(
                        workflowactivity=self,
                        state=current_state,
                        log_type=WorkflowHistory.ROLE,
                        participant=p_as_user,
                        note=note,
                        deadline=deadline
                        )
            wh.save()
            role_removed.send(sender=wh)
            return wh
        except ObjectDoesNotExist:
            # If we can't find the assignee then there is nothing to do
            pass
Test delete on models with related models. This is a crucial
dataset/ETHPy150Open ntoll/workflow/workflow/models.py/WorkflowActivity.clear_roles--crossover with--dataset/ETHPy150Open lsbardel/python-stdnet/tests/all/query/delete.py/TestDeleteScalarFields.testDeleteRelatedOneByOne