def checkForPropertyValue(obj, propertyName, expectedValues, refresh=False):
    """Utility method to check if a property on an object has one of the expected values.
    @param obj: the object to query
    @param propertyName: the name of the property to check
    @param expectedValues: a collection with the list of values for propertyName to check
    @param refresh: if True, then the object is refreshed using its httpRefresh() method
    """
    if refresh:
        obj.httpRefresh()
    value = getattr(obj, propertyName)
    if value in expectedValues:
        return True
    return False