def test_role_group(self): group = GroupFactory() bootstrap = Mock(groups={"group1": group}) component = Workflows(bootstrap) result = component.role({"group": "group1", "name": "Test role"}) self.assertEqual(result.name, "Test role") self.assertEqual(result.group, group)
def test_role_user(self): user = UserFactory() bootstrap = Mock(users={"user1": user}) component = Workflows(bootstrap) result = component.role({"user": "******", "name": "Test role"}) self.assertEqual(result.name, "Test role") self.assertEqual(result.user, user)