def test_init_role_modelview(self):
    role_name = 'MyRole2'
    role_perms = [('can_list', 'SomeModelView'), ('can_show', 'SomeModelView'), ('can_add', 'SomeModelView'), (permissions.ACTION_CAN_EDIT, 'SomeModelView'), (permissions.ACTION_CAN_DELETE, 'SomeModelView')]
    self.security_manager.init_role(role_name, role_perms)
    role = self.appbuilder.sm.find_role(role_name)
    self.assertIsNotNone(role)
    self.assertEqual(len(role_perms), len(role.permissions))
def test_init_role_modelview(self):
    role_name = 'MyRole2'
    role_perms = [('can_list', 'SomeModelView'), ('can_show', 'SomeModelView'), ('can_add', 'SomeModelView'), (permissions.ACTION_CAN_EDIT, 'SomeModelView'), (permissions.ACTION_CAN_DELETE, 'SomeModelView')]
    self.security_manager.init_role(role_name, role_perms)
    role = self.appbuilder.sm.find_role(role_name)
    self.assertIsNotNone(role)
    self.assertEqual(len(role_perms), len(role.permissions))