c2cgeoportal-commons 2.5.0.100__py3-none-any.whl → 2.9rc44__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of c2cgeoportal-commons might be problematic. Click here for more details.

Files changed (92) hide show
  1. c2cgeoportal_commons/__init__.py +2 -5
  2. c2cgeoportal_commons/alembic/env.py +52 -33
  3. c2cgeoportal_commons/alembic/main/028477929d13_add_technical_roles.py +10 -7
  4. c2cgeoportal_commons/alembic/main/04f05bfbb05e_remove_the_old_is_expanded_column.py +62 -0
  5. c2cgeoportal_commons/alembic/main/116b9b79fc4d_internal_and_external_layer_tables_.py +42 -43
  6. c2cgeoportal_commons/alembic/main/1418cb05921b_merge_1_6_and_master_branches.py +9 -8
  7. c2cgeoportal_commons/alembic/main/164ac0819a61_add_image_format_to_wmts_layer.py +9 -6
  8. c2cgeoportal_commons/alembic/main/166ff2dcc48d_create_database.py +22 -25
  9. c2cgeoportal_commons/alembic/main/16e43f8c0330_remove_old_metadata_column.py +9 -6
  10. c2cgeoportal_commons/alembic/main/1d5d4abfebd1_add_restricted_theme.py +14 -8
  11. c2cgeoportal_commons/alembic/main/1de20166b274_remove_v1_artifacts.py +9 -6
  12. c2cgeoportal_commons/alembic/main/20137477bd02_update_icons_url.py +9 -6
  13. c2cgeoportal_commons/alembic/main/21f11066f8ec_trigger_on_role_updates_user_in_static.py +21 -20
  14. c2cgeoportal_commons/alembic/main/22e6dfb556de_add_description_tree_.py +9 -6
  15. c2cgeoportal_commons/alembic/main/29f2a32859ec_merge_1_6_and_master_branches.py +9 -8
  16. c2cgeoportal_commons/alembic/main/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py +9 -6
  17. c2cgeoportal_commons/alembic/main/2e57710fecfe_update_the_ogc_server_for_ogc_api.py +71 -0
  18. c2cgeoportal_commons/alembic/main/32527659d57b_move_exclude_properties_from_layerv1_to_.py +15 -12
  19. c2cgeoportal_commons/alembic/main/32b21aa1d0ed_merge_e004f76e951a_and_e004f76e951a_.py +9 -8
  20. c2cgeoportal_commons/alembic/main/338b57593823_remove_trigger_on_role_name_change.py +25 -24
  21. c2cgeoportal_commons/alembic/main/415746eb9f6_changes_for_v2.py +45 -43
  22. c2cgeoportal_commons/alembic/main/44c91d82d419_add_table_log.py +72 -0
  23. c2cgeoportal_commons/alembic/main/5109242131ce_add_column_time_widget.py +11 -9
  24. c2cgeoportal_commons/alembic/main/52916d8fde8b_add_sql_fields_to_vector_tiles.py +60 -0
  25. c2cgeoportal_commons/alembic/main/53ba1a68d5fe_add_theme_to_fulltextsearch.py +9 -6
  26. c2cgeoportal_commons/alembic/main/54645a535ad6_add_ordering_in_relation.py +17 -14
  27. c2cgeoportal_commons/alembic/main/56dc90838d90_fix_removing_layerv1.py +10 -8
  28. c2cgeoportal_commons/alembic/main/596ba21e3833_separate_local_internal.py +13 -14
  29. c2cgeoportal_commons/alembic/main/678f88c7ad5e_add_vector_tiles_layers_table.py +9 -6
  30. c2cgeoportal_commons/alembic/main/6a412d9437b1_rename_serverogc_to_ogcserver.py +9 -6
  31. c2cgeoportal_commons/alembic/main/6d87fdad275a_convert_metadata_to_the_right_case.py +13 -20
  32. c2cgeoportal_commons/alembic/main/7530011a66a7_trigger_on_role_updates_user_in_static.py +21 -20
  33. c2cgeoportal_commons/alembic/main/78fd093c8393_add_api_s_intrfaces.py +36 -52
  34. c2cgeoportal_commons/alembic/main/7d271f4527cd_add_layer_column_in_layerv1_table.py +9 -6
  35. c2cgeoportal_commons/alembic/main/809650bd04c3_add_dimension_field.py +9 -6
  36. c2cgeoportal_commons/alembic/main/8117bb9bba16_use_dimension_on_all_the_layers.py +9 -6
  37. c2cgeoportal_commons/alembic/main/87f8330ed64e_add_missing_delete_cascades.py +305 -0
  38. c2cgeoportal_commons/alembic/main/9268a1dffac0_add_trigger_to_be_able_to_correctly_.py +11 -8
  39. c2cgeoportal_commons/alembic/main/94db7e7e5b21_merge_2_2_and_master_branches.py +9 -8
  40. c2cgeoportal_commons/alembic/main/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py +9 -6
  41. c2cgeoportal_commons/alembic/main/a00109812f89_add_field_layer_wms_valid.py +60 -0
  42. c2cgeoportal_commons/alembic/main/a4558f032d7d_add_support_of_cog_layers.py +74 -0
  43. c2cgeoportal_commons/alembic/main/a4f1aac9bda_merge_1_6_and_master_branches.py +9 -8
  44. c2cgeoportal_commons/alembic/main/b60f2a505f42_remame_uimetadata_to_metadata.py +9 -6
  45. c2cgeoportal_commons/alembic/main/b6b09f414fe8_sync_model_database.py +165 -0
  46. c2cgeoportal_commons/alembic/main/c75124553bf3_remove_deprecated_columns.py +9 -6
  47. c2cgeoportal_commons/alembic/main/d48a63b348f1_change_mapserver_url_for_docker.py +13 -14
  48. c2cgeoportal_commons/alembic/main/d8ef99bc227e_be_able_to_delete_a_linked_functionality.py +16 -13
  49. c2cgeoportal_commons/alembic/main/daf738d5bae4_merge_2_0_and_master_branches.py +9 -8
  50. c2cgeoportal_commons/alembic/main/dba87f2647f9_merge_2_2_on_2_3.py +9 -8
  51. c2cgeoportal_commons/alembic/main/e004f76e951a_add_missing_not_null.py +15 -32
  52. c2cgeoportal_commons/alembic/main/e7e03dedade3_put_the_default_wms_server_in_the_.py +13 -14
  53. c2cgeoportal_commons/alembic/main/e85afd327ab3_cascade_deletes_to_tsearch.py +9 -6
  54. c2cgeoportal_commons/alembic/main/ec82a8906649_add_missing_on_delete_cascade_on_layer_.py +13 -10
  55. c2cgeoportal_commons/alembic/main/ee25d267bf46_main_interface_desktop.py +11 -14
  56. c2cgeoportal_commons/alembic/main/eeb345672454_merge_2_4_and_master_branches.py +9 -8
  57. c2cgeoportal_commons/alembic/static/0c640a58a09a_add_opt_key_column.py +9 -6
  58. c2cgeoportal_commons/alembic/static/107b81f5b9fe_add_missing_delete_cascades.py +78 -0
  59. c2cgeoportal_commons/alembic/static/1857owc78a07_add_last_login_and_expiration_date.py +7 -6
  60. c2cgeoportal_commons/alembic/static/1da396a88908_move_user_table_to_static_schema.py +19 -20
  61. c2cgeoportal_commons/alembic/static/267b4c1bde2e_add_display_name_in_the_user_for_better_.py +62 -0
  62. c2cgeoportal_commons/alembic/static/3f89a7d71a5e_alter_column_url_to_remove_limitation.py +8 -7
  63. c2cgeoportal_commons/alembic/static/44c91d82d419_add_table_log.py +72 -0
  64. c2cgeoportal_commons/alembic/static/53d671b17b20_add_timezone_on_datetime_fields.py +9 -6
  65. c2cgeoportal_commons/alembic/static/5472fbc19f39_add_temp_password_column.py +9 -6
  66. c2cgeoportal_commons/alembic/static/76d72fb3fcb9_add_oauth2_pkce.py +70 -0
  67. c2cgeoportal_commons/alembic/static/7ef947f30f20_add_oauth2_tables.py +115 -0
  68. c2cgeoportal_commons/alembic/static/910b4ca53b68_sync_model_database.py +186 -0
  69. c2cgeoportal_commons/alembic/static/aa41e9613256_wip_add_openid_connect_support.py +64 -0
  70. c2cgeoportal_commons/alembic/static/ae5e88f35669_add_table_user_role.py +15 -18
  71. c2cgeoportal_commons/alembic/static/bd029dbfc11a_fill_tech_data_column.py +10 -8
  72. c2cgeoportal_commons/lib/email_.py +16 -18
  73. c2cgeoportal_commons/lib/literal.py +44 -0
  74. c2cgeoportal_commons/lib/url.py +221 -0
  75. c2cgeoportal_commons/lib/validators.py +2 -4
  76. c2cgeoportal_commons/models/__init__.py +19 -15
  77. c2cgeoportal_commons/models/main.py +1268 -266
  78. c2cgeoportal_commons/models/sqlalchemy.py +15 -19
  79. c2cgeoportal_commons/models/static.py +338 -63
  80. c2cgeoportal_commons/py.typed +0 -0
  81. c2cgeoportal_commons/testing/__init__.py +18 -13
  82. c2cgeoportal_commons/testing/initializedb.py +15 -14
  83. {c2cgeoportal_commons-2.5.0.100.dist-info → c2cgeoportal_commons-2.9rc44.dist-info}/METADATA +18 -23
  84. c2cgeoportal_commons-2.9rc44.dist-info/RECORD +89 -0
  85. {c2cgeoportal_commons-2.5.0.100.dist-info → c2cgeoportal_commons-2.9rc44.dist-info}/WHEEL +1 -1
  86. tests/conftest.py +4 -6
  87. c2cgeoportal_commons-2.5.0.100.dist-info/RECORD +0 -75
  88. tests/test_interface.py +0 -27
  89. tests/test_roles.py +0 -63
  90. tests/test_users.py +0 -71
  91. tests/test_validators.py +0 -20
  92. {c2cgeoportal_commons-2.5.0.100.dist-info → c2cgeoportal_commons-2.9rc44.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- # Copyright (c) 2017-2020, Camptocamp SA
1
+ # Copyright (c) 2017-2024, Camptocamp SA
4
2
  # All rights reserved.
5
3
 
6
4
  # Redistribution and use in source and binary forms, with or without
@@ -30,39 +28,42 @@
30
28
 
31
29
  import os
32
30
  import sys
33
- from typing import List
31
+ from typing import cast
34
32
 
33
+ import sqlalchemy
35
34
  from sqlalchemy.engine import Connection
36
35
  from sqlalchemy.orm import Session
37
36
 
38
37
  from c2cgeoportal_commons.models import Base
39
38
 
40
39
 
41
- def usage(argv: List[str]) -> None:
40
+ def usage(argv: list[str]) -> None:
41
+ """Get the usage."""
42
42
  cmd = os.path.basename(argv[0])
43
- print("usage: %s <config_uri> [var=value]\n" '(example: "%s development.ini")' % (cmd, cmd))
43
+ print(f"usage: {cmd} <config_uri> [var=value]\n" '(example: "{cmd} development.ini")')
44
44
  sys.exit(1)
45
45
 
46
46
 
47
47
  def schema_exists(connection: Connection, schema_name: str) -> bool:
48
- sql = """
48
+ """Get if the schema exist."""
49
+ sql = f"""
49
50
  SELECT count(*) AS count
50
51
  FROM information_schema.schemata
51
- WHERE schema_name = '{}';
52
- """.format(
53
- schema_name
54
- )
55
- result = connection.execute(sql)
52
+ WHERE schema_name = '{schema_name}';
53
+ """
54
+ result = connection.execute(sqlalchemy.text(sql))
56
55
  row = result.first()
57
- return row[0] == 1
56
+ return cast(bool, row[0] == 1) # type: ignore[index]
58
57
 
59
58
 
60
59
  def truncate_tables(connection: Connection) -> None:
60
+ """Truncate all the tables defined in the model."""
61
61
  for t in Base.metadata.sorted_tables:
62
- connection.execute("TRUNCATE TABLE {}.{} CASCADE;".format(t.schema, t.name))
62
+ connection.execute(sqlalchemy.text(f"TRUNCATE TABLE {t.schema}.{t.name} CASCADE;"))
63
63
 
64
64
 
65
65
  def setup_test_data(dbsession: Session) -> None:
66
+ """Initialize the testing data."""
66
67
  from c2cgeoportal_commons.models.main import Role # pylint: disable=import-outside-toplevel
67
68
  from c2cgeoportal_commons.models.static import User # pylint: disable=import-outside-toplevel
68
69
 
@@ -1,23 +1,27 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cgeoportal-commons
3
- Version: 2.5.0.100
3
+ Version: 2.9rc44
4
4
  Summary: c2cgeoportal commons
5
- Home-page: https://www.camptocamp.com/solutions/geospatial/
5
+ Home-page: https://github.com/camptocamp/c2cgeoportal/
6
6
  Author: Camptocamp
7
7
  Author-email: info@camptocamp.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
8
+ Keywords: web gis geoportail c2cgeoportal geocommune pyramid
9
+ Classifier: Development Status :: 6 - Mature
10
+ Classifier: Environment :: Web Environment
11
+ Classifier: Framework :: Pyramid
12
+ Classifier: Intended Audience :: Other Audience
13
+ Classifier: License :: OSI Approved :: BSD License
14
+ Classifier: Operating System :: OS Independent
10
15
  Classifier: Programming Language :: Python
11
16
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.5
13
- Classifier: Programming Language :: Python :: 3.6
14
- Classifier: Framework :: Pyramid
15
- Classifier: Topic :: Internet :: WWW/HTTP
16
- Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Topic :: Scientific/Engineering :: GIS
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.10
17
21
  Description-Content-Type: text/markdown
18
- Requires-Dist: c2c.template
19
22
  Requires-Dist: GeoAlchemy2
20
23
  Requires-Dist: papyrus
24
+ Requires-Dist: pyramid
21
25
  Requires-Dist: sqlalchemy
22
26
  Requires-Dist: transaction
23
27
  Requires-Dist: zope.event
@@ -25,23 +29,18 @@ Provides-Extra: broadcast
25
29
  Requires-Dist: c2cwsgiutils ; extra == 'broadcast'
26
30
  Provides-Extra: testing
27
31
  Requires-Dist: transaction ; extra == 'testing'
28
- Provides-Extra: tests
29
- Requires-Dist: c2c.template ; extra == 'tests'
30
- Requires-Dist: psycopg2-binary ; extra == 'tests'
31
- Requires-Dist: pytest ; extra == 'tests'
32
- Requires-Dist: pytest-cov ; extra == 'tests'
33
- Requires-Dist: flake8 ; extra == 'tests'
34
- Requires-Dist: PyYAML ; extra == 'tests'
35
32
  Provides-Extra: upgrade
36
33
  Requires-Dist: alembic ; extra == 'upgrade'
37
- Requires-Dist: psycopg2-binary ; extra == 'upgrade'
34
+ Requires-Dist: psycopg2 ; extra == 'upgrade'
38
35
 
39
36
  # c2cgeoportal_common
40
37
 
41
38
  ## Checkout
42
39
 
40
+ ```
43
41
  git clone git@github.com:camptocamp/c2cgeoportal.git
44
42
  cd common
43
+ ```
45
44
 
46
45
  ## Create virtual environment
47
46
 
@@ -55,16 +54,12 @@ sudo -u postgres psql -c "CREATE USER \"www-data\" WITH PASSWORD 'www-data';"
55
54
  DATABASE=geomapfish_tests
56
55
  sudo -u postgres psql -c "CREATE DATABASE $DATABASE WITH OWNER \"www-data\";"
57
56
  sudo -u postgres psql -d $DATABASE -c "CREATE EXTENSION postgis;"
58
-
59
57
  ```
60
- use common/testing/initialized.py to create the database (development.ini at admin side)
61
58
 
62
- ```
59
+ use `common/testing/initialized.py` to create the database (`development.ini` at admin side)
63
60
 
64
61
  ## Run the tests
65
62
 
66
63
  ```
67
64
  make test
68
65
  ```
69
-
70
-
@@ -0,0 +1,89 @@
1
+ c2cgeoportal_commons/__init__.py,sha256=lhrPRtwZVTucC_3OkwLp-tWAeb7eJ5TU097YK8hnoCM,2053
2
+ c2cgeoportal_commons/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ c2cgeoportal_commons/alembic/env.py,sha256=2yAJMeO6EAGUE4umsvSyhc8L1fcK8SiMl4zfB8HI0ww,5126
4
+ c2cgeoportal_commons/alembic/main/028477929d13_add_technical_roles.py,sha256=JrjHSFvFpQ7H164aX7IjXjWpZvySoRdIuPtopQJkqro,2861
5
+ c2cgeoportal_commons/alembic/main/04f05bfbb05e_remove_the_old_is_expanded_column.py,sha256=kjbiE2sKBvMHhC5Kp98D1iHfWoZKOhNcY9Cs7JkxQmc,2301
6
+ c2cgeoportal_commons/alembic/main/116b9b79fc4d_internal_and_external_layer_tables_.py,sha256=hW6EnlkF8737mSszsUMqadM-sAazgJu7AQGZapqTpnw,8813
7
+ c2cgeoportal_commons/alembic/main/1418cb05921b_merge_1_6_and_master_branches.py,sha256=ZNzgZtLbPQS_-mJ-4vv77YI87BHoPOfHx5tLJKhHUh8,1991
8
+ c2cgeoportal_commons/alembic/main/164ac0819a61_add_image_format_to_wmts_layer.py,sha256=p3s3EfxTWv4EJRva0M5ntcImCB9xx23giRXYj0fI7N4,2233
9
+ c2cgeoportal_commons/alembic/main/166ff2dcc48d_create_database.py,sha256=U__28RLeUZlYPqj4ZzPQXxsevvajldjPG8jtNIcsjS4,11277
10
+ c2cgeoportal_commons/alembic/main/16e43f8c0330_remove_old_metadata_column.py,sha256=e_tYdb1Cb9ZFLWMGtqjGgYktAiwJI7FlPbeH4Z3hoIA,2264
11
+ c2cgeoportal_commons/alembic/main/1d5d4abfebd1_add_restricted_theme.py,sha256=031drRHUvTXjd27L4vG1gj4lRG4fXADa9d3MI7vTuJ8,2865
12
+ c2cgeoportal_commons/alembic/main/1de20166b274_remove_v1_artifacts.py,sha256=ubEtu1__8Hw_cAy_y5mCnCsy-vpvUPHUo4eOYBrzlQc,3410
13
+ c2cgeoportal_commons/alembic/main/20137477bd02_update_icons_url.py,sha256=i50Bwk3znadPSphsk4CuVBDln2m0lK_tsmaQMVeaFqA,3574
14
+ c2cgeoportal_commons/alembic/main/21f11066f8ec_trigger_on_role_updates_user_in_static.py,sha256=smHCvRaII02XENpbMkZeJn3pcEVOU6bbRp_tPmwfchY,2825
15
+ c2cgeoportal_commons/alembic/main/22e6dfb556de_add_description_tree_.py,sha256=Qy1cawz3wvpn9LAj5o6EWejTYxxVM6wwvrQeIKDUSuw,2429
16
+ c2cgeoportal_commons/alembic/main/29f2a32859ec_merge_1_6_and_master_branches.py,sha256=pSdLGBe3J7vJx7EBWo2r5bNUEJCs2MYbl1lorkL_1Wk,1991
17
+ c2cgeoportal_commons/alembic/main/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py,sha256=3G_NaCeC5tR8_wIjUCB_-vavpgqhCtVgrG9XEQ5UhwA,2291
18
+ c2cgeoportal_commons/alembic/main/2e57710fecfe_update_the_ogc_server_for_ogc_api.py,sha256=Rs4X8yBkjZCErgyKbJe_YuWQr1277QfFRobLoM5FKpo,2912
19
+ c2cgeoportal_commons/alembic/main/32527659d57b_move_exclude_properties_from_layerv1_to_.py,sha256=mt3tDOa3GsySL0BEENm8Wv9iWKWHIG8AKsfXc1Ev0yE,2786
20
+ c2cgeoportal_commons/alembic/main/32b21aa1d0ed_merge_e004f76e951a_and_e004f76e951a_.py,sha256=1wRDK3vX6AiKZNSh-skPX74_4inCzctUyJZ85i5xh64,2003
21
+ c2cgeoportal_commons/alembic/main/338b57593823_remove_trigger_on_role_name_change.py,sha256=a0s_7nMtl1Y9l1rfMNeiKVWunFR6zrjPrvVdMJsmHh8,2809
22
+ c2cgeoportal_commons/alembic/main/415746eb9f6_changes_for_v2.py,sha256=5LVWXf1vPz2xJonsCIPt8qxz0XL-6XXSEN17AoW0xOY,15973
23
+ c2cgeoportal_commons/alembic/main/44c91d82d419_add_table_log.py,sha256=se9R_YbQ-WIg-MeRYKpk2WXXw1sazycc_l_LfKU23ME,2735
24
+ c2cgeoportal_commons/alembic/main/5109242131ce_add_column_time_widget.py,sha256=e3n20dUz-OSoTPUJJsF0yxs3-90s6noFiR7GASfF5iU,2566
25
+ c2cgeoportal_commons/alembic/main/52916d8fde8b_add_sql_fields_to_vector_tiles.py,sha256=A8s6p-G_2F5v-YTd7jE6FyquQFzM876dJL7tC765txg,2307
26
+ c2cgeoportal_commons/alembic/main/53ba1a68d5fe_add_theme_to_fulltextsearch.py,sha256=zje6opfjk__g9lnn_6nabzJoFGxsUwZ_JXGJ1-oWCwY,3018
27
+ c2cgeoportal_commons/alembic/main/54645a535ad6_add_ordering_in_relation.py,sha256=-bgcRf_7VutUJ8IIDW0aO87fyx2j3n_9cvAoAviMcuA,3559
28
+ c2cgeoportal_commons/alembic/main/56dc90838d90_fix_removing_layerv1.py,sha256=_gXMQhUdLsy4DDtpuiQvn2lcjr7SqqQcapz2Lgqhs1k,2349
29
+ c2cgeoportal_commons/alembic/main/596ba21e3833_separate_local_internal.py,sha256=QSg-K9Z6HT-zjyNAulVZgS7fhrElK1I_N13VDVRc_lo,2432
30
+ c2cgeoportal_commons/alembic/main/678f88c7ad5e_add_vector_tiles_layers_table.py,sha256=WoF0MbY-3ID4PLOFT8qzrN1n8_LTW1zgD6qC-L1hlTg,2461
31
+ c2cgeoportal_commons/alembic/main/6a412d9437b1_rename_serverogc_to_ogcserver.py,sha256=uXI9KUR82Dl-NYyz7VwbWjwVkAK_GdolltTqDEGWhbI,2516
32
+ c2cgeoportal_commons/alembic/main/6d87fdad275a_convert_metadata_to_the_right_case.py,sha256=OSMYB99wPGdFEq6vGArIWscsz72fx8QNM6mV5oQVkFg,2541
33
+ c2cgeoportal_commons/alembic/main/7530011a66a7_trigger_on_role_updates_user_in_static.py,sha256=JED0wqgWK36lUMbc1aCUH4-DjDA9r7fp70pQaS640SQ,2825
34
+ c2cgeoportal_commons/alembic/main/78fd093c8393_add_api_s_intrfaces.py,sha256=qG0xiv-l80MyJ0ImKOrNY5aEt7WK8EhtTUdOx8NfL6E,4891
35
+ c2cgeoportal_commons/alembic/main/7d271f4527cd_add_layer_column_in_layerv1_table.py,sha256=AqwBGIkZkXTBEjrtfcHM4LEyM_3HJY-f9DOHGiz1A98,2466
36
+ c2cgeoportal_commons/alembic/main/809650bd04c3_add_dimension_field.py,sha256=aO4FSr23eVPcLX_ScANVSjECiyB_b4hV30h-ZhVDQQE,2273
37
+ c2cgeoportal_commons/alembic/main/8117bb9bba16_use_dimension_on_all_the_layers.py,sha256=Ga0LyrjKCXA0MqXgM3TxCQSwxsJiemh602xAhWpnqzk,2993
38
+ c2cgeoportal_commons/alembic/main/87f8330ed64e_add_missing_delete_cascades.py,sha256=GGQ60GCPbyGoop6vSo4wNBCW1Z2t_bLE4-X1yfnbsiA,9381
39
+ c2cgeoportal_commons/alembic/main/9268a1dffac0_add_trigger_to_be_able_to_correctly_.py,sha256=921qKiy_73VPnQzmGOyVS2PNExaJZebjCUtU54ko28o,2747
40
+ c2cgeoportal_commons/alembic/main/94db7e7e5b21_merge_2_2_and_master_branches.py,sha256=o2jxdlGAsjHxZG9GPquQBKA-KE8lCmGb_wCX9DQBiQs,1991
41
+ c2cgeoportal_commons/alembic/main/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py,sha256=PWh8cknpdMGry070NmUXyMJDUviiC2My4J4qfFr_XEI,6831
42
+ c2cgeoportal_commons/alembic/main/a00109812f89_add_field_layer_wms_valid.py,sha256=lKGaCawaB0G3F72pDdsFBnBPsulrGSdubHxewGNomDo,2422
43
+ c2cgeoportal_commons/alembic/main/a4558f032d7d_add_support_of_cog_layers.py,sha256=lP49YAcmzEvcRrmNWwkrNqzmO6AXz6VZqTWFvpauoGA,2628
44
+ c2cgeoportal_commons/alembic/main/a4f1aac9bda_merge_1_6_and_master_branches.py,sha256=UOmbeBX2LlQlIb8ozDJamRPkxn-fZhTGRY7MCuafHEg,1989
45
+ c2cgeoportal_commons/alembic/main/b60f2a505f42_remame_uimetadata_to_metadata.py,sha256=AUOvLwCYLY9VYQ9qcW9ikf88135xFo_RrMG73MJXwUQ,2212
46
+ c2cgeoportal_commons/alembic/main/b6b09f414fe8_sync_model_database.py,sha256=g4CDH0tuv_S0inYfN-pFZvcp5tZeg5P69CnueI1WpY8,6418
47
+ c2cgeoportal_commons/alembic/main/c75124553bf3_remove_deprecated_columns.py,sha256=2d0sDT_G2uEPGpIpCq70T57jaldIxNHRl9stB2ccOIU,2447
48
+ c2cgeoportal_commons/alembic/main/d48a63b348f1_change_mapserver_url_for_docker.py,sha256=vDIgYu6XKH82K9fE_t0JlGVF1dGM1hrcL89faHhk3mk,2470
49
+ c2cgeoportal_commons/alembic/main/d8ef99bc227e_be_able_to_delete_a_linked_functionality.py,sha256=feDsuwIAUOQsT7kLMBiD3McUSjepV_NOy2MbiO9lYQI,3447
50
+ c2cgeoportal_commons/alembic/main/daf738d5bae4_merge_2_0_and_master_branches.py,sha256=KP5Lb-bGxusShIPXoYzLFq2ousCrmwMT1ITPU7vT9y4,1991
51
+ c2cgeoportal_commons/alembic/main/dba87f2647f9_merge_2_2_on_2_3.py,sha256=lcBUAd4-VRNO34yFFopfXZQGtxkvjiYZq32HuC-bY1o,1978
52
+ c2cgeoportal_commons/alembic/main/e004f76e951a_add_missing_not_null.py,sha256=Ckt-kd9XGsZTiAUVq8cnnHa5z9CKJX5JESqMw_VNq8U,4193
53
+ c2cgeoportal_commons/alembic/main/e7e03dedade3_put_the_default_wms_server_in_the_.py,sha256=sehRIDAxsYxiHCkkWRGO0osyCpWyt4HZNprNk6oW5YM,3077
54
+ c2cgeoportal_commons/alembic/main/e85afd327ab3_cascade_deletes_to_tsearch.py,sha256=G_Hz6qkXE_eqfJ8WF8WEkAKpui3--P0-ItKcBHNScsQ,3351
55
+ c2cgeoportal_commons/alembic/main/ec82a8906649_add_missing_on_delete_cascade_on_layer_.py,sha256=EDVdynK4m7SKmf7RrMdKWmQnYe2CcJqJqwhYQlEFyJQ,2990
56
+ c2cgeoportal_commons/alembic/main/ee25d267bf46_main_interface_desktop.py,sha256=xT3HdDp3ikp9Eaa9kf42KAY0ryxgSEBLeRrQpz3QMY0,2276
57
+ c2cgeoportal_commons/alembic/main/eeb345672454_merge_2_4_and_master_branches.py,sha256=4xEgz2wHUnLp2S0VMnRFUfHeiLlToNmcOgXbnQd5eBo,1992
58
+ c2cgeoportal_commons/alembic/static/0c640a58a09a_add_opt_key_column.py,sha256=M6St-7YVr0k3OFYy_XqIzYSL7RRXjsaA0zalp5a134s,2328
59
+ c2cgeoportal_commons/alembic/static/107b81f5b9fe_add_missing_delete_cascades.py,sha256=hdhfTkEt7IkHcsgAdSmfX4tgxussYs8nbw8ljOLP1oU,2776
60
+ c2cgeoportal_commons/alembic/static/1857owc78a07_add_last_login_and_expiration_date.py,sha256=cu-v4pJDGLBPbYjh_LRX0M6a4Cnva74LGo5NB4Zcoj8,2673
61
+ c2cgeoportal_commons/alembic/static/1da396a88908_move_user_table_to_static_schema.py,sha256=p9f68bbBhj2JPxMWPFXCdzDxdbT-1RoFL9MrmH4sHTw,6171
62
+ c2cgeoportal_commons/alembic/static/267b4c1bde2e_add_display_name_in_the_user_for_better_.py,sha256=ZQeR0B98oJ7EXT0WjDVBtENQVcQEFrrbb32JN5bOZ-Y,2480
63
+ c2cgeoportal_commons/alembic/static/3f89a7d71a5e_alter_column_url_to_remove_limitation.py,sha256=DAWT-uqq8qI8-qzcWxaaXS12oxteOnwvGnNg0hVlrJQ,2113
64
+ c2cgeoportal_commons/alembic/static/44c91d82d419_add_table_log.py,sha256=vKWxdTx9BzAyCLYeIXDZVpHS9M_xlofnsi8LeThNlic,2777
65
+ c2cgeoportal_commons/alembic/static/53d671b17b20_add_timezone_on_datetime_fields.py,sha256=WFYVS7hcsKuSl7Zg1Z_kKZaO-cLUMIauaJJP1W5zJcU,2740
66
+ c2cgeoportal_commons/alembic/static/5472fbc19f39_add_temp_password_column.py,sha256=D-WDG0qgmbjsErSyAqqPc2-yfQ-tMzLYgKtXx9do7RY,2293
67
+ c2cgeoportal_commons/alembic/static/76d72fb3fcb9_add_oauth2_pkce.py,sha256=emWc91zfKJfc2HAjv1xfYxNqRAs6ZiiguJ8a8uktUp8,3171
68
+ c2cgeoportal_commons/alembic/static/7ef947f30f20_add_oauth2_tables.py,sha256=cb-3uJrvywOAxR7HF8h3UAd3C8qyJcxnpDmBhehPu_M,4127
69
+ c2cgeoportal_commons/alembic/static/910b4ca53b68_sync_model_database.py,sha256=gj7EWQqTid0l-p3BybtLqUaNEk4X9yUGgwd3MAOmGjw,7161
70
+ c2cgeoportal_commons/alembic/static/aa41e9613256_wip_add_openid_connect_support.py,sha256=Vd82tSDKsoxgG2K7Q3wArPD60SL5BtnFaBCkaq5EhV8,2501
71
+ c2cgeoportal_commons/alembic/static/ae5e88f35669_add_table_user_role.py,sha256=nDmtAfB90VflhXJDXDUwZQxR0yVpOHhx3zn-GvZB8CU,3436
72
+ c2cgeoportal_commons/alembic/static/bd029dbfc11a_fill_tech_data_column.py,sha256=OUJuuib1CQYJnPlpv6L7NA6oJfhxIJ4KZbSvU8vVZlE,2132
73
+ c2cgeoportal_commons/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
+ c2cgeoportal_commons/lib/email_.py,sha256=2JPWMYJ0CHx-qUMBC6YnFjLwUSAOWtgeDgCS1tTvy-Y,3475
75
+ c2cgeoportal_commons/lib/literal.py,sha256=AUvu_Gj-fiYgXTdorJV1XLPW0i5bzpWeMxGPl1hTKLg,2023
76
+ c2cgeoportal_commons/lib/url.py,sha256=yl9vYJmgfoRTAH79UPp6Dt-e5JKwV3cYfELS10O3w0M,8244
77
+ c2cgeoportal_commons/lib/validators.py,sha256=dF0Qlg6ghMrxwNqV675Juz5fIx9-58f4JimV7SC-sqc,1805
78
+ c2cgeoportal_commons/models/__init__.py,sha256=lH45DyppwMI-GV36oiHOBPQ1B8F6U-WxuhIYFlS25zY,2694
79
+ c2cgeoportal_commons/models/main.py,sha256=oL79ZeXFbtVGjX0CkR5HSbZZYj1g28dU8QJ2FA5VxIA,65519
80
+ c2cgeoportal_commons/models/sqlalchemy.py,sha256=0G1ZLjxDx4CQLl0OKz-lQrXLLKGuxnRFZDlUCamby-k,2823
81
+ c2cgeoportal_commons/models/static.py,sha256=zQx3qP9CI8FvxqkyjyDSighMARBjnHonNVPyvb0vI3E,18782
82
+ c2cgeoportal_commons/testing/__init__.py,sha256=E_CJMEWjf87NZMNNp-2OhgcZD6LvxGHplZXNLZYSl3U,4081
83
+ c2cgeoportal_commons/testing/initializedb.py,sha256=jsFzMimA_wPbp0DwniGiM_ekngDyX57mqoI6_ioNPUY,3224
84
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
+ tests/conftest.py,sha256=DdCNLXAzOwjztauMELLHQsdzcuQgx83Jfy-0JUu-OCs,1450
86
+ c2cgeoportal_commons-2.9rc44.dist-info/METADATA,sha256=agPZBkYQ1uWcUmuoktylRVjy9RADsifNH46cLzqnv7Q,1803
87
+ c2cgeoportal_commons-2.9rc44.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
88
+ c2cgeoportal_commons-2.9rc44.dist-info/top_level.txt,sha256=NWDBsLJav5VgJVX1XzTwUvFShioh9XSi5IaJU_9_YDc,27
89
+ c2cgeoportal_commons-2.9rc44.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.34.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tests/conftest.py CHANGED
@@ -1,13 +1,11 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- from logging.config import fileConfig
4
1
  import os
2
+ from logging.config import fileConfig
5
3
 
6
- from c2c.template.config import config
7
4
  import plaster
8
5
  import pytest
9
- from sqlalchemy.exc import DBAPIError
10
6
  import transaction
7
+ from c2c.template.config import config
8
+ from sqlalchemy.exc import DBAPIError
11
9
 
12
10
  from c2cgeoportal_commons.testing import generate_mappers, get_engine, get_session_factory, get_tm_session
13
11
  from c2cgeoportal_commons.testing.initializedb import truncate_tables
@@ -18,9 +16,9 @@ from c2cgeoportal_commons.testing.initializedb import truncate_tables
18
16
  def dbsession(settings):
19
17
  generate_mappers()
20
18
  engine = get_engine(settings)
21
- truncate_tables(engine)
22
19
  session_factory = get_session_factory(engine)
23
20
  session = get_tm_session(session_factory, transaction.manager)
21
+ truncate_tables(session)
24
22
  return session
25
23
 
26
24
 
@@ -1,75 +0,0 @@
1
- c2cgeoportal_commons/__init__.py,sha256=5RrnNP3HA4cxq0RbSQGszV8g8Xelqda9Lrc2ruxZU2k,2145
2
- c2cgeoportal_commons/alembic/env.py,sha256=OiJhCqt-MZJVHqAPp6mPxE3FUVNFxFxZv7sgvjT6R9w,4480
3
- c2cgeoportal_commons/alembic/main/028477929d13_add_technical_roles.py,sha256=SuyoQvB4oWarwtSitFPxTgGhBjJsA1Cck60w5ka42yI,2814
4
- c2cgeoportal_commons/alembic/main/116b9b79fc4d_internal_and_external_layer_tables_.py,sha256=qVrSxwRfASeu4ZenPsVgT-EUwpvH9E0ZKNAS7-PxLfc,9009
5
- c2cgeoportal_commons/alembic/main/1418cb05921b_merge_1_6_and_master_branches.py,sha256=KhjcDF0RlwTafPRUy-M1XI7DJ88F9386pgOM1Lu2SdA,1944
6
- c2cgeoportal_commons/alembic/main/164ac0819a61_add_image_format_to_wmts_layer.py,sha256=J4HPA4ZsfuEDNWnHT8mhZRWiDTMo9UqfEXG5SUQQnZY,2158
7
- c2cgeoportal_commons/alembic/main/166ff2dcc48d_create_database.py,sha256=lBTgABIXWaigQrB2G7f6tZXSz9CrIbD8NsDvsbg1BNo,11251
8
- c2cgeoportal_commons/alembic/main/16e43f8c0330_remove_old_metadata_column.py,sha256=ynE4Co6nHb0oe-0ICLa3mYiW9lVAkRQ0xWgesXODh9w,2184
9
- c2cgeoportal_commons/alembic/main/1d5d4abfebd1_add_restricted_theme.py,sha256=tEsVGEl_-TKCEPILNkcbBgZJyrorjWEZnKtZHgpyNcQ,2724
10
- c2cgeoportal_commons/alembic/main/1de20166b274_remove_v1_artifacts.py,sha256=Zd7-oClZdtt25JhdB68IJtrWMbaP6SmHcnu1IuAbbHE,3330
11
- c2cgeoportal_commons/alembic/main/20137477bd02_update_icons_url.py,sha256=N39fMLjlgPDCmzJ9pH1EP7vIhXkedVq4aXY4Dnbglxk,3499
12
- c2cgeoportal_commons/alembic/main/21f11066f8ec_trigger_on_role_updates_user_in_static.py,sha256=s0pN1iH1eQ1psWbCSF_HoaT12Kr7dkl_S-NveYmE73Y,2732
13
- c2cgeoportal_commons/alembic/main/22e6dfb556de_add_description_tree_.py,sha256=bKKGJRK9M26pYgVwOwvkfTlC65D9Rq97p2rmc6BdR_0,2354
14
- c2cgeoportal_commons/alembic/main/29f2a32859ec_merge_1_6_and_master_branches.py,sha256=oCjzNpefDVGtpDOPJ-x_1m0UsHw_qHkHVvozUTh0eD4,1944
15
- c2cgeoportal_commons/alembic/main/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py,sha256=Jjjz0GkcsywQJIIjt67utZGRGg-8JmebDreELoFL_9s,2216
16
- c2cgeoportal_commons/alembic/main/32527659d57b_move_exclude_properties_from_layerv1_to_.py,sha256=I1UDFGhqoCkZEMuKafzVl7ke6OXs9lOWErwOxe5P31g,2757
17
- c2cgeoportal_commons/alembic/main/32b21aa1d0ed_merge_e004f76e951a_and_e004f76e951a_.py,sha256=GqZ1iMRLkgHDbGt33U9FvOIL1wZ1H3ZVMpj_G-7Tf7Q,1956
18
- c2cgeoportal_commons/alembic/main/338b57593823_remove_trigger_on_role_name_change.py,sha256=qL17W7ADUaNilRU2lzn1J8-zbFzOpuI36dV8S16HC8E,2778
19
- c2cgeoportal_commons/alembic/main/415746eb9f6_changes_for_v2.py,sha256=3ur0smaO3P0LCJYWLSYdfa-YDPOiEACs6YeKNk7AUfY,16186
20
- c2cgeoportal_commons/alembic/main/5109242131ce_add_column_time_widget.py,sha256=4f4gE1xG7QjEHaEJ-pcva5fIXCnLL7OuDR19-tBKTfE,2512
21
- c2cgeoportal_commons/alembic/main/53ba1a68d5fe_add_theme_to_fulltextsearch.py,sha256=75PYWyJsZiHLVJnYtoH75RH4Bu7fK0V-MvZEVpcFnaA,2943
22
- c2cgeoportal_commons/alembic/main/54645a535ad6_add_ordering_in_relation.py,sha256=fbdX2w1CQf_dXeyYdvzG30KQxd6OVo0zq9RROMAKf1s,3576
23
- c2cgeoportal_commons/alembic/main/56dc90838d90_fix_removing_layerv1.py,sha256=XgVK_aU3_0diT54m0bPd43pCLwjcXcbRECYUNdUfE2Q,2299
24
- c2cgeoportal_commons/alembic/main/596ba21e3833_separate_local_internal.py,sha256=OXOv06epSxGjeTG4F2R76ntyRBIwyOYohzmq2_hxUdQ,2435
25
- c2cgeoportal_commons/alembic/main/678f88c7ad5e_add_vector_tiles_layers_table.py,sha256=zb0rVpAOAlsNHXO5ucKJucVo17fQpaQxvb-dzgN9Mwo,2381
26
- c2cgeoportal_commons/alembic/main/6a412d9437b1_rename_serverogc_to_ogcserver.py,sha256=f2TrTv5OQu4cd4oOuUp0dgn3MNluEZQCcf2Zs6fUlcw,2441
27
- c2cgeoportal_commons/alembic/main/6d87fdad275a_convert_metadata_to_the_right_case.py,sha256=N4gFyvPZ6hV6tSeeud33qNrkhCBdg0D-a0QPfgAv2aE,2649
28
- c2cgeoportal_commons/alembic/main/7530011a66a7_trigger_on_role_updates_user_in_static.py,sha256=gRz2AkZFKFghupam7HX_Z91GeC7XPONtvpa9DYkvFjw,2732
29
- c2cgeoportal_commons/alembic/main/78fd093c8393_add_api_s_intrfaces.py,sha256=INqtdkTfwFT_L5BCrI1x5-A9qQQsolr9gLYfUHjEebU,5168
30
- c2cgeoportal_commons/alembic/main/7d271f4527cd_add_layer_column_in_layerv1_table.py,sha256=nDZLJZHF5pip0g9gMyiWLBMN8bQ9LdvIpltDE70GTak,2391
31
- c2cgeoportal_commons/alembic/main/809650bd04c3_add_dimension_field.py,sha256=ySFgqqc5Sl-hhbTA0hUjf9Cq9YyVAQ3pEMhMg1wewtY,2198
32
- c2cgeoportal_commons/alembic/main/8117bb9bba16_use_dimension_on_all_the_layers.py,sha256=cnMl12NHtrcvdcnOUjzaCww3m6r5KtV5htUfzioqrNM,2918
33
- c2cgeoportal_commons/alembic/main/9268a1dffac0_add_trigger_to_be_able_to_correctly_.py,sha256=RGibtXpLZsJNPyeFSGjSpUC6HC7cqCFq98M2yIbd9cE,2714
34
- c2cgeoportal_commons/alembic/main/94db7e7e5b21_merge_2_2_and_master_branches.py,sha256=H1KJxqJ4dVTdhr0GUUQRKJSDyDKuacGY5p8922sL-jI,1939
35
- c2cgeoportal_commons/alembic/main/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py,sha256=wgYuoGiXN3ikuwiSIBsINSFuKHsjHk5Kx0xmjOIUMvE,6756
36
- c2cgeoportal_commons/alembic/main/a4f1aac9bda_merge_1_6_and_master_branches.py,sha256=OQZR8exJ33CM63DJeuYt0Ga4cGBcZc0Ho7x8lJMNRhY,1942
37
- c2cgeoportal_commons/alembic/main/b60f2a505f42_remame_uimetadata_to_metadata.py,sha256=ecPuks9BxtXauCToENT-KwJ80TNbmu_ABwhpbAhWC6E,2137
38
- c2cgeoportal_commons/alembic/main/c75124553bf3_remove_deprecated_columns.py,sha256=lZEEEK8wb6rlUpnPqLozDRjqBXxl-sZ2coKjLBCDuw0,2367
39
- c2cgeoportal_commons/alembic/main/d48a63b348f1_change_mapserver_url_for_docker.py,sha256=xEGN8TDKRBkCLTehhCSNgG3bcvb4weTI9-peYr-Ia6I,2468
40
- c2cgeoportal_commons/alembic/main/d8ef99bc227e_be_able_to_delete_a_linked_functionality.py,sha256=e8f9A8sHK4oyN2prKlCADOLFPQaiA6vibb0E9pXIS9k,3428
41
- c2cgeoportal_commons/alembic/main/daf738d5bae4_merge_2_0_and_master_branches.py,sha256=DiAzjwmoA9z7qcXk1tT5dmMq3Z8gydDAKbLjhglY69A,1944
42
- c2cgeoportal_commons/alembic/main/dba87f2647f9_merge_2_2_on_2_3.py,sha256=-FB18beAHKzYXlddS79y_WHwUGOGwzleZ8f6FKHcuzw,1931
43
- c2cgeoportal_commons/alembic/main/e004f76e951a_add_missing_not_null.py,sha256=MznymyDyjsN49g7VMuuZyjpxkRP4tuICe_v0Iubgkqw,4416
44
- c2cgeoportal_commons/alembic/main/e7e03dedade3_put_the_default_wms_server_in_the_.py,sha256=LwkmB56Ar9NV5T8bC5foFTM9PvdyXbSQSFpr6ZZFNVU,3080
45
- c2cgeoportal_commons/alembic/main/e85afd327ab3_cascade_deletes_to_tsearch.py,sha256=Z114mcYsR7h5FG5ApIt9pPU44eilIC_b4rkbesA9F3I,3271
46
- c2cgeoportal_commons/alembic/main/ec82a8906649_add_missing_on_delete_cascade_on_layer_.py,sha256=wACV1W0M-FWiUW_yo4xxOgszUEWqyLWRJG5is4S6428,2947
47
- c2cgeoportal_commons/alembic/main/ee25d267bf46_main_interface_desktop.py,sha256=bYmCysuyDhBfaA4t9Ca3IDA9Ydz5eU3WDySTIHoFGho,2293
48
- c2cgeoportal_commons/alembic/main/eeb345672454_merge_2_4_and_master_branches.py,sha256=ScQDxjaSM4EVo4akJsY6gMyp05fLyZAyoLIvp2elFa0,1940
49
- c2cgeoportal_commons/alembic/static/0c640a58a09a_add_opt_key_column.py,sha256=X_folmObf_VhePM1U-x4PXls0k09q1r-oPWU0JTKYCU,2248
50
- c2cgeoportal_commons/alembic/static/1857owc78a07_add_last_login_and_expiration_date.py,sha256=Alp7TqFwcnTrfCo7zrxDFcPMCtgjzTkuOyzWhy-6474,2600
51
- c2cgeoportal_commons/alembic/static/1da396a88908_move_user_table_to_static_schema.py,sha256=36uh48FuAOefoDLKmKmyKOlUTIFkAqnNdHGZqFic3uM,6170
52
- c2cgeoportal_commons/alembic/static/3f89a7d71a5e_alter_column_url_to_remove_limitation.py,sha256=3nDavllVEsokcda_Ebp0XnLcJNDlKgZ9qG3FrHRKPaA,2048
53
- c2cgeoportal_commons/alembic/static/53d671b17b20_add_timezone_on_datetime_fields.py,sha256=0aUJ_pKTI7xVaG-EMzlZBIEj5EzZjnWtI0LwwhnVb48,2665
54
- c2cgeoportal_commons/alembic/static/5472fbc19f39_add_temp_password_column.py,sha256=cYsPqdIU6FDFvs4_ct7CDJRaQVqQRj_E7YmeZ-XDCwM,2218
55
- c2cgeoportal_commons/alembic/static/ae5e88f35669_add_table_user_role.py,sha256=yqSraXRrceSK1vsRP7QKfzC4--omAkm0z2z4qSTE2CE,3571
56
- c2cgeoportal_commons/alembic/static/bd029dbfc11a_fill_tech_data_column.py,sha256=oMISM3tfQGmhRDkvjH9Piz-UI68NPABzgJuyIDgiv5s,2094
57
- c2cgeoportal_commons/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- c2cgeoportal_commons/lib/email_.py,sha256=aE2mth5wdX9L2XkzoksGov2or1YwVvg_Qh7KFp2wK3U,3439
59
- c2cgeoportal_commons/lib/validators.py,sha256=2U8MwQjU9fB5NYAXfK29CvyWFa9BKWRlv-PBPa8TlsM,1838
60
- c2cgeoportal_commons/models/__init__.py,sha256=-Kc0N-f_LiK-Hal1TuZkUDguNybOYv5gjtOXP3MxVU4,2577
61
- c2cgeoportal_commons/models/main.py,sha256=L3WbjZqmb6V2GtMkdvjk2fVNeln8-_atd_HEtyH7E_U,34861
62
- c2cgeoportal_commons/models/sqlalchemy.py,sha256=1s7Uc1i77EmkLJGj-tbi-tw8ARYVG2lTfO41Ww9Ybo4,2804
63
- c2cgeoportal_commons/models/static.py,sha256=dUx369xr3GL0u1fnRWjm4RMi_xpLu2oyRP847l_wIeM,9021
64
- c2cgeoportal_commons/testing/__init__.py,sha256=dDCXYVxjS4qzkvn-MGZMLuKcyZAJuExNS5HrmqxJsME,3698
65
- c2cgeoportal_commons/testing/initializedb.py,sha256=8nQPLPWfJhhGCL2Io5V6L4x_hyI4yxRX0KYSs9K8WSw,3045
66
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
- tests/conftest.py,sha256=m7c3v9uRqcRQgIq5bvDi_dpuXb7fs4aexHfhJ6CU0gA,1474
68
- tests/test_interface.py,sha256=8n0ZmjpJmprQhbsBXumFEptUABdAHIRCIX1Ne55SlK0,787
69
- tests/test_roles.py,sha256=txCNuEybrBiQjOE5jywGxfSLdxCmUyabSZcbMR7MOaA,1847
70
- tests/test_users.py,sha256=qBntppiCVWR_iXv-5q5fxpYTFRvjvH9K3Hef7yAAkUo,2548
71
- tests/test_validators.py,sha256=M-diSLPUk8aEeqRx57oFi8M-R1_N3-vtnjgzVoWKAEg,483
72
- c2cgeoportal_commons-2.5.0.100.dist-info/METADATA,sha256=oBp4YlhKYIGIBm_yhSyMGWFX2e5noyPzkm186M3lfj4,1897
73
- c2cgeoportal_commons-2.5.0.100.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
74
- c2cgeoportal_commons-2.5.0.100.dist-info/top_level.txt,sha256=NWDBsLJav5VgJVX1XzTwUvFShioh9XSi5IaJU_9_YDc,27
75
- c2cgeoportal_commons-2.5.0.100.dist-info/RECORD,,
tests/test_interface.py DELETED
@@ -1,27 +0,0 @@
1
- # pylint: disable=no-self-use
2
-
3
- import pytest
4
-
5
-
6
- @pytest.mark.usefixtures("transact")
7
- class TestInterface:
8
- def test_delete_cascade_to_tsearch(self, dbsession):
9
- from c2cgeoportal_commons.models.main import Interface, FullTextSearch
10
- from sqlalchemy import func
11
-
12
- interface = Interface("desktop", "Desktop interface")
13
- interface_id = interface.id
14
-
15
- fts = FullTextSearch()
16
- fts.label = "Text to search"
17
- fts.interface = interface
18
- fts.ts = func.to_tsvector("french", fts.label)
19
- dbsession.add(fts)
20
- dbsession.flush()
21
-
22
- dbsession.delete(interface)
23
- dbsession.flush()
24
-
25
- assert (
26
- 0 == dbsession.query(FullTextSearch).filter(FullTextSearch.interface_id == interface_id).count()
27
- )
tests/test_roles.py DELETED
@@ -1,63 +0,0 @@
1
- # pylint: disable=no-self-use
2
-
3
- import pytest
4
-
5
-
6
- @pytest.fixture(scope="class")
7
- @pytest.mark.usefixtures("dbsession")
8
- def insert_roles_test_data(dbsession):
9
- from c2cgeoportal_commons.models.main import Role
10
- from c2cgeoportal_commons.models.static import User
11
-
12
- role = Role("secretary")
13
-
14
- user = User("user1", roles=[role])
15
-
16
- t = dbsession.begin_nested()
17
-
18
- dbsession.add(role)
19
- dbsession.add(user)
20
- dbsession.flush()
21
-
22
- yield
23
-
24
- t.rollback()
25
-
26
-
27
- @pytest.mark.usefixtures("insert_roles_test_data", "transact")
28
- class TestRole:
29
- def test_select(self, dbsession):
30
- from c2cgeoportal_commons.models.main import Role
31
-
32
- roles = dbsession.query(Role).all()
33
- assert len(roles) == 1, "querying for roles"
34
- assert roles[0].name == "secretary", "role from test data is secretary"
35
-
36
- def test_delete(self, dbsession):
37
- from c2cgeoportal_commons.models.main import Role
38
- from c2cgeoportal_commons.models.static import user_role
39
-
40
- roles = dbsession.query(Role).all()
41
- dbsession.delete(roles[0])
42
- roles = dbsession.query(Role).all()
43
- assert len(roles) == 0, "removed a role"
44
- assert 0 == dbsession.query(user_role).count()
45
-
46
- def test_delete_cascade_to_tsearch(self, dbsession):
47
- from c2cgeoportal_commons.models.main import Role, FullTextSearch
48
- from sqlalchemy import func
49
-
50
- role = dbsession.query(Role).filter(Role.name == "secretary").one()
51
- role_id = role.id
52
-
53
- fts = FullTextSearch()
54
- fts.label = "Text to search"
55
- fts.role = role
56
- fts.ts = func.to_tsvector("french", fts.label)
57
- dbsession.add(fts)
58
- dbsession.flush()
59
-
60
- dbsession.delete(role)
61
- dbsession.flush()
62
-
63
- assert 0 == dbsession.query(FullTextSearch).filter(FullTextSearch.role_id == role_id).count()
tests/test_users.py DELETED
@@ -1,71 +0,0 @@
1
- # pylint: disable=no-self-use
2
-
3
- import pytest
4
-
5
-
6
- @pytest.fixture(scope="class")
7
- @pytest.mark.usefixtures("dbsession")
8
- def insert_users_test_data(dbsession):
9
- from c2cgeoportal_commons.models.static import User
10
- from c2cgeoportal_commons.models.main import Role
11
-
12
- user = User("babar")
13
- user.roles = [Role(name="Role1"), Role(name="Role2")]
14
- t = dbsession.begin_nested()
15
- dbsession.add(user)
16
- dbsession.flush()
17
- yield
18
- t.rollback()
19
-
20
-
21
- @pytest.mark.usefixtures("insert_users_test_data", "transact")
22
- class TestUser:
23
- def test_select(self, dbsession):
24
- from c2cgeoportal_commons.models.static import User
25
-
26
- users = dbsession.query(User).all()
27
- assert len(users) == 1, "querying for users"
28
- assert users[0].username == "babar", "user from test data is babar"
29
- assert 2 == len(users[0].roles)
30
-
31
- def test_remove(self, dbsession):
32
- from c2cgeoportal_commons.models.static import User
33
- from c2cgeoportal_commons.models.static import user_role
34
-
35
- users = dbsession.query(User).all()
36
- dbsession.delete(users[0])
37
- users = dbsession.query(User).all()
38
- assert len(users) == 0, "removed a user"
39
- assert 0 == dbsession.query(user_role).count()
40
-
41
- def test_add(self, dbsession):
42
- from c2cgeoportal_commons.models.static import User
43
- from c2cgeoportal_commons.models.main import Role
44
- from c2cgeoportal_commons.models.static import user_role
45
-
46
- user = User(username="momo")
47
- user.roles = [Role(name="Role3")]
48
- dbsession.begin_nested()
49
- dbsession.add(user)
50
- dbsession.commit()
51
- assert dbsession.query(User).count() == 2, "added a user"
52
- dbsession.expire(user)
53
- assert user.username == "momo", "added user is momo"
54
- assert 1 == len(user.roles)
55
- assert user.roles[0].name == "Role3"
56
- assert 1 == dbsession.query(user_role).filter(user_role.c.user_id == user.id).count()
57
-
58
- @staticmethod
59
- def test_edit(dbsession):
60
- from c2cgeoportal_commons.models.static import User
61
- from c2cgeoportal_commons.models.main import Role
62
- from c2cgeoportal_commons.models.static import user_role
63
-
64
- user = dbsession.query(User).first()
65
- assert 2 == len(user.roles)
66
- user.roles = [Role(name="Role4")]
67
- dbsession.flush()
68
- dbsession.expire(user)
69
- assert 1 == len(user.roles)
70
- assert user.roles[0].name == "Role4"
71
- assert 1 == dbsession.query(user_role).filter(user_role.c.user_id == user.id).count()
tests/test_validators.py DELETED
@@ -1,20 +0,0 @@
1
- # pylint: disable=no-self-use
2
-
3
- import pytest
4
-
5
- from c2cgeoportal_commons.lib.validators import url
6
-
7
-
8
- class TestUrl:
9
- @pytest.mark.parametrize(
10
- "valid_url",
11
- [
12
- "http://geomapfish.org",
13
- "https://geomapfish.org/functionalities",
14
- "geomapfish.org/functionalities",
15
- "static://img/cadastre.jpeg",
16
- "config://internal/mapserv",
17
- ],
18
- )
19
- def test_valid_url(self, valid_url):
20
- url(None, valid_url)