Example #1
0
 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)
Example #2
0
 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)