

def test_has_permissions(self):
    self.assertQuerysetEqual(TestWorkflow._cls_registry, [])
    TestWorkflow.register(AdminStep)
    flow = TestWorkflow(self.request)
    step = AdminStep(flow)
    self.assertItemsEqual(step.permissions, ('horizon.test',))
    self.assertQuerysetEqual(flow.steps, ['<TestStepOne: test_action_one>', '<TestStepTwo: test_action_two>'])
    self.set_permissions(['test'])
    self.request.user = self.user
    flow = TestWorkflow(self.request)
    self.assertQuerysetEqual(flow.steps, ['<TestStepOne: test_action_one>', '<AdminStep: admin_action>', '<TestStepTwo: test_action_two>'])

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