Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 15, 2024
1 parent bd36164 commit cd31753
Show file tree
Hide file tree
Showing 22 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion geoportal/tests/functional/test_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def setup_method(self, _):
a_geo_table.drop(checkfirst=True, bind=engine)
a_geo_table.create(bind=engine)

ogcserver = create_default_ogcserver()
ogcserver = create_default_ogcserver(DBSession)

private_layer_edit = LayerWMS(name="__test_private_layer_edit", public=False)
private_layer_edit.layer = "__test_private_layer"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_functionalities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -43,7 +43,7 @@ def setup_method(self, _):
from c2cgeoportal_commons.models.main import Functionality, Role
from c2cgeoportal_commons.models.static import User

create_default_ogcserver()
create_default_ogcserver(DBSession)
role1 = Role(name="__test_role1")
user1 = User(username="__test_user1", password="__test_user1", settings_role=role1, roles=[role1])
role2 = Role(name="__test_role2")
Expand Down
2 changes: 1 addition & 1 deletion geoportal/tests/functional/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def setup_method(self, _: Any) -> None:
DBSession.add(self.role)
DBSession.add(self.main)

create_default_ogcserver()
create_default_ogcserver(DBSession)

transaction.commit()

Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_mapserverproxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -136,7 +136,7 @@ def setup_method(self, _):

setup_db()

ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)
ogcserver_geoserver = OGCServer(name="__test_ogc_server_geoserver")
ogcserver_geoserver.url = mapserv_url
ogcserver_geoserver.type = OGCSERVER_TYPE_GEOSERVER
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -54,7 +54,7 @@ def setup_method(self, _):
from c2cgeoportal_commons.models.static import User

setup_db()
create_default_ogcserver()
create_default_ogcserver(DBSession)

ogcserver_jpeg = OGCServer(name="__test_ogc_server_jpeg")
ogcserver_jpeg.url = mapserv_url
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_mapserverproxy_group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -43,7 +43,7 @@ def setup_method(self, _):
from c2cgeoportal_commons.models.main import Interface, LayerWMS, RestrictionArea, Role
from c2cgeoportal_commons.models.static import User

ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)

role1 = Role(name="__test_role1", description="__test_role1")
user1 = User(username="__test_user1", password="__test_user1", settings_role=role1, roles=[role1])
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_mobile_desktop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -46,7 +46,7 @@ def setup_method(self, _):
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Interface, LayerGroup, LayerWMS, Theme

create_default_ogcserver()
create_default_ogcserver(DBSession)
main = Interface(name="main")
mobile = Interface(name="mobile")

Expand Down
4 changes: 1 addition & 3 deletions geoportal/tests/functional/test_themes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import pytest
import transaction
from pyramid import testing
from tests.functional import create_dummy_request


Expand All @@ -54,7 +53,6 @@ def themes_setup(dbsession, default_ogcserver):
mobile = Interface(name="mobile")
min_levels = Interface(name="min_levels")

ogc_server_internal = default_ogcserver(dbsession)
ogc_server_external = OGCServer(
name="__test_ogc_server_chtopo",
url="http://wms.geo.admin.ch/",
Expand All @@ -67,7 +65,7 @@ def themes_setup(dbsession, default_ogcserver):
layer_internal_wms.layer = "__test_layer_internal_wms"
layer_internal_wms.interfaces = [main, min_levels]
layer_internal_wms.metadatas = [Metadata("test", "internal_wms")]
layer_internal_wms.ogc_server = ogc_server_internal
layer_internal_wms.ogc_server = default_ogcserver

layer_external_wms = LayerWMS(
name="__test_layer_external_wms", layer="ch.swisstopo.dreiecksvermaschung", public=True
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_dimensions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016-2023, Camptocamp SA
# Copyright (c) 2016-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -54,7 +54,7 @@ def setup_method(self, _):
Theme,
)

ogc_server = create_default_ogcserver()
ogc_server = create_default_ogcserver(DBSession)
main = Interface(name="main")

layer_wms_1 = LayerWMS(name="__test_layer_wms_1", public=True)
Expand Down
2 changes: 1 addition & 1 deletion geoportal/tests/functional/test_themes_edit_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def setup_method(self, _: Any) -> None:
)
self.main = Interface(name="main")

self.ogc_server = create_default_ogcserver()
self.ogc_server = create_default_ogcserver(DBSession)
self.ogc_server.auth = OGCSERVER_AUTH_NOAUTH

self.metadata = None
Expand Down
2 changes: 1 addition & 1 deletion geoportal/tests/functional/test_themes_editing.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def setup_method(self, _):

setup_db()

ogcserver = create_default_ogcserver()
ogcserver = create_default_ogcserver(DBSession)

role1 = Role(name="__test_role1")
user1 = User(username="__test_user1", password="__test_user1", settings_role=role1, roles=[role1])
Expand Down
2 changes: 1 addition & 1 deletion geoportal/tests/functional/test_themes_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def setup_method(self, _):
a_geo_table.drop(checkfirst=True, bind=engine)
a_geo_table.create(bind=engine)

ogcserver = create_default_ogcserver()
ogcserver = create_default_ogcserver(DBSession)

private_layer_edit = LayerWMS(name="__test_private_layer_edit", public=False)
private_layer_edit.layer = "__test_private_layer"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_layermultinameerror.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -48,7 +48,7 @@ def setup_method(self, _):

main = Interface(name="desktop")

ogc_server = create_default_ogcserver()
ogc_server = create_default_ogcserver(DBSession)

layer_wms_1 = LayerWMS(name="__test_layer_wms_1", public=True)
layer_wms_1.layer = "testpoint_unprotected"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_loop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -47,7 +47,7 @@ def setup_method(self, _):
from c2cgeoportal_commons.models import DBSession
from c2cgeoportal_commons.models.main import Interface, LayerGroup, LayerWMS, Theme

ogc_server = create_default_ogcserver()
ogc_server = create_default_ogcserver(DBSession)
main = Interface(name="desktop2")

layer = LayerWMS(name="__test_layer", public=True)
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -49,7 +49,7 @@ def setup_method(self, _):

desktop = Interface(name="desktop")

ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)

layer_wms = LayerWMS(name="__test_layer_internal_wms", public=True)
layer_wms.layer = "testpoint_unprotected"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_mixed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016-2023, Camptocamp SA
# Copyright (c) 2016-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -56,7 +56,7 @@ def setup_method(self, _):

main = Interface(name="main")

ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)
ogc_server_external = OGCServer(
name="__test_ogc_server_external",
url="https://wms.geo.admin.ch/",
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_nameerror.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -48,7 +48,7 @@ def setup_method(self, _):

main = Interface(name="desktop")

ogc_server = create_default_ogcserver()
ogc_server = create_default_ogcserver(DBSession)

layer_wms = LayerWMS(name="__test_layer_wms", public=True)
layer_wms.layer = "testpoint_unprotected"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def setup_method(self, _):

main = Interface(name="desktop")

ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)

layer_internal_wms = LayerWMS(name="__test_layer_internal_wms", public=True)
layer_internal_wms.layer = "__test_layer_internal_wms"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_private.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -63,7 +63,7 @@ def setUp(self): # noqa
role2 = Role(name="__test_role2")
user2 = User(username="__test_user2", password="__test_user", settings_role=role, roles=[role, role2])
user2.email = "[email protected]"
ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)

layer_wms = LayerWMS(name="__test_layer_wms", public=True)
layer_wms.layer = "__test_public_layer"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_scale.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -47,7 +47,7 @@ def setup_method(self, _):

main = Interface(name="desktop")

ogc_server = create_default_ogcserver()
ogc_server = create_default_ogcserver(DBSession)

layer_noscale = LayerWMS(name="__test_layer_noscale", public=True)
layer_noscale.layer = "test_noscale"
Expand Down
4 changes: 2 additions & 2 deletions geoportal/tests/functional/test_themes_time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2023, Camptocamp SA
# Copyright (c) 2013-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -66,7 +66,7 @@ def setup_method(self, _):
DBSession.query(PointTest).delete()

main = Interface(name="desktop")
ogc_server = create_default_ogcserver()
ogc_server = create_default_ogcserver(DBSession)

layer_wms_1 = LayerWMS(name="__test_layer_time_1", public=True)
layer_wms_1.layer = "test_wmstime"
Expand Down
8 changes: 5 additions & 3 deletions geoportal/tests/functional/test_tinyowsproxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2015-2023, Camptocamp SA
# Copyright (c) 2015-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -89,7 +89,7 @@ def setup_method(self, _):
user2.roles = [role2]
user2.email = "Tarenpion"

ogc_server_internal = create_default_ogcserver()
ogc_server_internal = create_default_ogcserver(DBSession)

main = Interface(name="main")

Expand Down Expand Up @@ -304,12 +304,14 @@ class TestTinyOWSProxyViewNoDb(TestCase):
transaction_insert_request_file = data_base + "tinyows_transaction_insert_request.xml"

def setup_method(self, _):
from c2cgeoportal_commons.models import DBSession

# Always see the diff
# https://docs.python.org/2/library/unittest.html#unittest.TestCase.maxDiff
self.maxDiff = None

cleanup_db()
create_default_ogcserver()
create_default_ogcserver(DBSession)

def teardown_method(self, _):
cleanup_db()
Expand Down

0 comments on commit cd31753

Please sign in to comment.