Exemplo n.º 1
0
    def setup_class(cls):
        if engine_is_sqlite():
            raise SkipTest("PostGIS is required for this test")

        # This will create the PostGIS tables (geometry_columns and
        # spatial_ref_sys) which were deleted when rebuilding the database
        table = Table('geometry_columns', meta.metadata)
        if not table.exists():
            setup_postgis_tables()

        spatial_db_setup()

        # Setup the harvest tables
        harvest_model_setup()
Exemplo n.º 2
0
    def setup_class(cls):
        if engine_is_sqlite():
            raise SkipTest("PostGIS is required for this test")
        
        # This will create the PostGIS tables (geometry_columns and
        # spatial_ref_sys) which were deleted when rebuilding the database
        table = Table('geometry_columns', meta.metadata)
        if not table.exists():
            setup_postgis_tables()

        spatial_db_setup()

        # Setup the harvest tables
        harvest_model_setup()
Exemplo n.º 3
0
def spatial_clean_db(reset_db):
    reset_db()

    # This will create the PostGIS tables (geometry_columns and
    # spatial_ref_sys) which were deleted when rebuilding the database
    table = Table("spatial_ref_sys", meta.metadata)
    if not table.exists():
        create_postgis_tables()

        # When running the tests with the --reset-db option for some
        # reason the metadata holds a reference to the `package_extent`
        # table after being deleted, causing an InvalidRequestError
        # exception when trying to recreate it further on
        if "package_extent" in meta.metadata.tables:
            meta.metadata.remove(meta.metadata.tables["package_extent"])

    spatial_db_setup()

    # Setup the harvest tables
    harvest_model_setup()
    def setup_class(cls):
        if engine_is_sqlite():
            raise SkipTest("PostGIS is required for this test")

        # This will create the PostGIS tables (geometry_columns and
        # spatial_ref_sys) which were deleted when rebuilding the database
        table = Table('spatial_ref_sys', meta.metadata)
        if not table.exists():
            create_postgis_tables()

            # When running the tests with the --reset-db option for some
            # reason the metadata holds a reference to the `package_extent`
            # table after being deleted, causing an InvalidRequestError
            # exception when trying to recreate it further on
            if 'package_extent' in meta.metadata.tables:
                meta.metadata.remove(meta.metadata.tables['package_extent'])

        spatial_db_setup()

        # Setup the harvest tables
        harvest_model_setup()
Exemplo n.º 5
0
    def setup_class(cls):
        ''' '''
        if engine_is_sqlite():
            raise SkipTest(u'PostGIS is required for this test')

        # This will create the PostGIS tables (geometry_columns and
        # spatial_ref_sys) which were deleted when rebuilding the database
        table = Table(u'spatial_ref_sys', meta.metadata)
        if not table.exists():
            create_postgis_tables()

            # When running the tests with the --reset-db option for some
            # reason the metadata holds a reference to the `package_extent`
            # table after being deleted, causing an InvalidRequestError
            # exception when trying to recreate it further on
            if u'package_extent' in meta.metadata.tables:
                meta.metadata.remove(meta.metadata.tables[u'package_extent'])

        spatial_db_setup()

        # Setup the harvest tables
        harvest_model_setup()
Exemplo n.º 6
0
def spatial_setup():
    create_postgis_tables()
    spatial_db_setup()