def auto_workflow_test(self):
        for key, trans in self.transitions.items():

            obj = trans['object'] or self.get_object(trans['object_key'])

            if obj._bmfmeta.workflow.key != trans['state']:
                raise ImproperlyConfigured(
                    'Object "%s" is in the wrong state for transitions["%s"]' % (
                        obj,
                        key,
                    )
                )

            user = trans['user'] or self.user

            try:
                obj._bmfmeta.workflow.transition(trans['transition'], user, silent=True)
            except __HOLE__ as e:
                raise ImproperlyConfigured(
                    'Object "%s" raised a Validation error for transitions["%s"]: %s' % (
                        obj,
                        key,
                        e,
                    )
                )

            if trans['object_key']:
                new_key = '%s:%s' % (
                    trans['object_key'],
                    obj._bmfmeta.workflow.key
                )

                if not self.objects.get(new_key, None):
                    self.objects[new_key] = obj
dataset/ETHPy150Open django-bmf/django-bmf/djangobmf/utils/testcases.py/WorkflowTestFactory.auto_workflow_test