'Test get_assigned_roles'

def testGetAssignedRoles(self):

    assertEqual = self.assertEqual
    assertNotEqual = self.assertNotEqual
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    get_assigned_roles = self.rm.get_assigned_roles
    org_id = self.org_id
    user_id = self.user_id
    roles = get_assigned_roles(entity_id=org_id)
    assertTrue((user_id in roles))
    assigned_roles = roles[user_id]
    assertEqual(len(assigned_roles), 2)
    assertTrue(('staff_reader' in assigned_roles))
    assertTrue(('project_editor' in assigned_roles))
    roles = get_assigned_roles(entity_id=org_id, user_id=user_id)
    assertTrue((user_id in roles))
    assigned_roles = roles[user_id]
    assertEqual(len(assigned_roles), 2)
    assertTrue(('staff_reader' in assigned_roles))
    assertTrue(('project_editor' in assigned_roles))
    assigned_roles = get_assigned_roles(user_id=user_id)
    assertTrue(all([(r in assigned_roles[org_id]) for r in ('staff_reader', 'project_editor')]))
    assertEqual(len(assigned_roles[org_id]), 2)
    roles = get_assigned_roles(user_id=user_id)
    assertTrue((org_id in roles))
    assigned_roles = roles[org_id]
    assertEqual(len(assigned_roles), 2)
    assertTrue(('staff_reader' in assigned_roles))
    assertTrue(('project_editor' in assigned_roles))
    with self.assertRaises(RuntimeError):
        get_assigned_roles()
