

def test_workflow_validation(self):
    flow = TestWorkflow(self.request)
    with self.assertRaises(exceptions.WorkflowValidationError):
        flow.is_valid()
    seed = {
        'project_id': PROJECT_ID,
        'user_id': self.user.id,
        'instance_id': INSTANCE_ID,
    }
    req = self.factory.post('/', seed)
    req.user = self.user
    flow = TestWorkflow(req, context_seed={
        'project_id': PROJECT_ID,
    })
    for step in flow.steps:
        if (not step.action.is_valid()):
            self.fail(('Step %s was unexpectedly invalid: %s' % (step.slug, step.action.errors)))
    self.assertTrue(flow.is_valid())
    flow.context.set('extra_data', 'foo')
    self.assertTrue(flow.is_valid())

dataset/ETHPy150Open CiscoSystems/avos/horizon/test/tests/workflows.py WorkflowsTests.test_workflow_validation/original