def test_property_groups():
    with _get_portal_connection() as connection:
        property_group_to_create = PropertyGroup('propertygrouptest')
        created_property_group = \
            create_property_group(property_group_to_create, connection)
        eq_(property_group_to_create.name, created_property_group.name)

        all_property_groups = get_all_property_groups(connection)
        assert_in(created_property_group, all_property_groups)

        delete_property_group(created_property_group.name, connection)

        all_property_groups = get_all_property_groups(connection)
        assert_not_in(created_property_group, all_property_groups)
示例#2
0
def test_property_groups():
    with _get_portal_connection() as connection:
        property_group_to_create = PropertyGroup('propertygrouptest')
        created_property_group = \
            create_property_group(property_group_to_create, connection)
        eq_(property_group_to_create.name, created_property_group.name)

        all_property_groups = get_all_property_groups(connection)
        assert_in(created_property_group, all_property_groups)

        delete_property_group(created_property_group.name, connection)

        all_property_groups = get_all_property_groups(connection)
        assert_not_in(created_property_group, all_property_groups)
def test_properties():
    with _get_portal_connection() as connection:
        all_property_groups = get_all_property_groups(connection)
        first_property_group = all_property_groups[0]
        property_to_create = StringProperty(
            'propertytest',
            'Property Test',
            'Just a test property',
            first_property_group.name,
            'text',
            )
        created_property = create_property(property_to_create, connection)
        eq_(property_to_create, created_property)

        all_properties = get_all_properties(connection)
        assert_in(created_property, all_properties)

        delete_property(created_property.name, connection)

        all_properties = get_all_properties(connection)
        assert_not_in(created_property, all_properties)
示例#4
0
def test_properties():
    with _get_portal_connection() as connection:
        all_property_groups = get_all_property_groups(connection)
        first_property_group = all_property_groups[0]
        property_to_create = StringProperty(
            'propertytest',
            'Property Test',
            'Just a test property',
            first_property_group.name,
            'text',
        )
        created_property = create_property(property_to_create, connection)
        eq_(property_to_create, created_property)

        all_properties = get_all_properties(connection)
        assert_in(created_property, all_properties)

        delete_property(created_property.name, connection)

        all_properties = get_all_properties(connection)
        assert_not_in(created_property, all_properties)
示例#5
0
    def _test_retrieved_property_group_equal(self, property_groups):
        simulator = GetAllPropertyGroups(property_groups)
        with MockPortalConnection(simulator) as connection:
            retrieved_property_groups = get_all_property_groups(connection)

        eq_(property_groups, retrieved_property_groups)