-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #411 from PnX-SI/develop
Develop > Master / Release 1.12.0
- Loading branch information
Showing
21 changed files
with
239 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.11.3 | ||
1.12.0 |
54 changes: 54 additions & 0 deletions
54
apptax/migrations/versions/32c5ed42bdbd_add_table_t_meta_taxref.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"""Add table: t_meta_taxref | ||
Revision ID: 32c5ed42bdbd | ||
Revises: 3bd542b72955 | ||
Create Date: 2023-06-23 15:51:00.031901 | ||
""" | ||
import datetime | ||
from alembic import op | ||
from sqlalchemy import Column, Unicode, DateTime, Integer, func | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "32c5ed42bdbd" | ||
down_revision = "3bd542b72955" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"t_meta_taxref", | ||
Column("referencial_name", Unicode, primary_key=True), | ||
Column("version", Integer, primary_key=True), | ||
Column("update_date", DateTime, server_default=func.now()), | ||
schema="taxonomie", | ||
) | ||
op.execute( | ||
""" | ||
WITH meta_taxref AS ( | ||
SELECT 1019039 as max_cd_nom, 16 AS taxref_version | ||
UNION | ||
SELECT 1002708 as max_cd_nom, 15 AS taxref_version | ||
UNION | ||
SELECT 972486 as max_cd_nom, 14 AS taxref_version | ||
UNION | ||
SELECT 935095 as max_cd_nom, 13 AS taxref_version | ||
UNION | ||
SELECT 887126 as max_cd_nom, 11 AS taxref_version | ||
) | ||
INSERT INTO taxonomie.t_meta_taxref (referencial_name, version) | ||
SELECT 'taxref', taxref_version | ||
FROM taxonomie.taxref AS t | ||
JOIN meta_taxref m | ||
ON t.cd_nom = max_cd_nom | ||
ORDER BY cd_nom DESC | ||
LIMIT 1; | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_table(table_name="t_meta_taxref", schema="taxonomie") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
|
||
from flask import url_for | ||
|
||
from .fixtures import * | ||
from schema import Schema, Optional, Or | ||
|
||
|
||
@pytest.mark.usefixtures("client_class", "temporary_transaction") | ||
class TestApiBibListe: | ||
schema_cor_nom_liste = Schema( | ||
{ | ||
"items": [{"cd_nom": int, "id_liste": int}], | ||
"total": int, | ||
"limit": int, | ||
"page": int, | ||
} | ||
) | ||
|
||
def test_cor_nom_liste(self, noms_example): | ||
response = self.client.get( | ||
url_for("bib_listes.get_cor_nom_liste"), | ||
) | ||
assert response.status_code == 200 | ||
data = response.json | ||
assert len(data["items"]) > 0 | ||
self.schema_cor_nom_liste.validate(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule UsersHub-authentification-module
updated
7 files
+1 −1 | VERSION | |
+25 −0 | docs/changelog.rst | |
+1 −0 | src/pypnusershub/db/models.py | |
+53 −28 | src/pypnusershub/routes.py | |
+0 −0 | src/pypnusershub/tests/__init__.py | |
+41 −0 | src/pypnusershub/tests/test_utils.py | |
+25 −3 | src/pypnusershub/utils.py |
Submodule Utils-Flask-SQLAlchemy
updated
7 files
+3 −0 | .git-blame-ignore-revs | |
+1 −1 | VERSION | |
+23 −2 | docs/changelog.rst | |
+33 −19 | src/utils_flask_sqla/generic.py | |
+6 −0 | src/utils_flask_sqla/schema.py | |
+1 −6 | src/utils_flask_sqla/serializers.py | |
+19 −1 | src/utils_flask_sqla/tests/test_schema.py |
Submodule Utils-Flask-SQLAlchemy-Geo
updated
7 files
+1 −1 | VERSION | |
+15 −0 | docs/changelog.rst | |
+160 −0 | src/utils_flask_sqla_geo/export.py | |
+62 −2 | src/utils_flask_sqla_geo/generic.py | |
+44 −6 | src/utils_flask_sqla_geo/schema.py | |
+106 −39 | src/utils_flask_sqla_geo/tests/test_schema.py | |
+47 −0 | src/utils_flask_sqla_geo/utils.py |
Oops, something went wrong.