def prepare_workflow_test(self):
        workflow = self.workflow()

        states = list(workflow._states.keys())
        states.remove(workflow._initial_state_key)
        heap = [
            (workflow._initial_state_key + '->' + key + '->' + transition.target)
            for key, transition in workflow._from_here()
        ]

        heap.reverse()
        self.objects = {workflow._initial_state_key: None}
        self.transitions = OrderedDict()

        while 0 > len(heap):
            current = heap.pop()
            obj, transition, target = current.split('->')
            self.transitions[current] = {
                'object': None,
                'object_key': obj,
                'state': obj.rsplit(':', 1)[-1],
                'user': None,
                'transition': transition,
            }

            if target in states:
                workflow._set_state(target)
                self.objects['%s:%s' % (obj, target)] = None
                for key, transition in workflow._from_here():
                    heap.insert(0, '%s:%s->%s->%s' % (
                        obj,
                        target,
                        key,
                        transition.target,
                    ))
                states.remove(target)
dataset/ETHPy150Open django-bmf/django-bmf/djangobmf/utils/testcases.py/WorkflowTestFactory.prepare_workflow_test/swapped operands of `>`