'Test that before/after works'

def testUpdateRoles(self):

    before = ('staff_reader', 'project_editor')
    after = ('survey_reader',)
    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    rm = self.rm
    get_assigned_roles = rm.get_assigned_roles
    update_roles = rm.update_roles
    org_id = self.org_id
    user_id = self.user_id
    update_roles(user_id, org_id, before, after)
    assigned_roles = get_assigned_roles(user_id=user_id)
    assertTrue((org_id in assigned_roles))
    assertTrue(all([(r in assigned_roles[org_id]) for r in after]))
    assertEqual(len(assigned_roles[org_id]), len(after))
    update_roles(user_id, org_id, after, before)
    assigned_roles = get_assigned_roles(user_id=user_id)
    assertTrue((org_id in assigned_roles))
    assertTrue(all([(r in assigned_roles[org_id]) for r in before]))
    assertEqual(len(assigned_roles[org_id]), len(before))
