Skip to content
Snippets Groups Projects
Commit e94f9a88 authored by Remco Tukker's avatar Remco Tukker
Browse files

better name for enum file

parent 2709d22f
Branches
Tags
1 merge request!79COMP-283 datamodels
This commit is part of merge request !79. Comments created here will be created in the context of that merge request.
...@@ -11,8 +11,9 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship ...@@ -11,8 +11,9 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
from sqlalchemy.schema import ForeignKey from sqlalchemy.schema import ForeignKey
from compendium_v2.db import db from compendium_v2.db import db
from compendium_v2.db.model_enums import CarryMechanism, CommarcialChargingLevel, UserCategory, ServiceCategory, \ from compendium_v2.db.presentation_model_enums import CarryMechanism, CommarcialChargingLevel, UserCategory, \
ConnectivityCoverage, ConnectionMethod, YesNoPlanned, MonitoringMethod, CommercialConnectivityCoverage, FeeType ConnectivityCoverage, ConnectionMethod, YesNoPlanned, MonitoringMethod, CommercialConnectivityCoverage, \
FeeType, ServiceCategory
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -2,7 +2,7 @@ import logging ...@@ -2,7 +2,7 @@ import logging
import openpyxl import openpyxl
import os import os
from compendium_v2.db.model_enums import FeeType from compendium_v2.db.presentation_model_enums import FeeType
from compendium_v2.environment import setup_logging from compendium_v2.environment import setup_logging
setup_logging() setup_logging()
......
...@@ -18,7 +18,7 @@ from compendium_v2.db import db ...@@ -18,7 +18,7 @@ from compendium_v2.db import db
from compendium_v2.db.presentation_models import BudgetEntry, ChargingStructure, ECProject, ExternalConnections, \ from compendium_v2.db.presentation_models import BudgetEntry, ChargingStructure, ECProject, ExternalConnections, \
InstitutionURLs, NrenStaff, ParentOrganization, Policy, SubOrganization, TrafficVolume, ExternalConnection, \ InstitutionURLs, NrenStaff, ParentOrganization, Policy, SubOrganization, TrafficVolume, ExternalConnection, \
FundingSource FundingSource
from compendium_v2.db.model_enums import FeeType from compendium_v2.db.presentation_model_enums import FeeType
from compendium_v2.db.survey_models import ResponseStatus, SurveyResponse from compendium_v2.db.survey_models import ResponseStatus, SurveyResponse
......
...@@ -17,7 +17,7 @@ from sqlalchemy import delete, text ...@@ -17,7 +17,7 @@ from sqlalchemy import delete, text
from collections import defaultdict from collections import defaultdict
import compendium_v2 import compendium_v2
from compendium_v2.db.model_enums import FeeType from compendium_v2.db.presentation_model_enums import FeeType
from compendium_v2.environment import setup_logging from compendium_v2.environment import setup_logging
from compendium_v2.config import load from compendium_v2.config import load
from compendium_v2.publishers.helpers import extract_urls from compendium_v2.publishers.helpers import extract_urls
......
from sqlalchemy import select from sqlalchemy import select
from compendium_v2.db import db, presentation_models, model_enums from compendium_v2.db import db, presentation_model_enums, presentation_models
from compendium_v2.publishers.survey_publisher_old_db_2022 import _cli, FundingSource, \ from compendium_v2.publishers.survey_publisher_old_db_2022 import _cli, FundingSource, \
StaffQuestion, OrgQuestion, ChargingStructure, ECQuestion StaffQuestion, OrgQuestion, ChargingStructure, ECQuestion
...@@ -282,11 +282,11 @@ def test_publisher(app_with_survey_db, mocker, dummy_config): ...@@ -282,11 +282,11 @@ def test_publisher(app_with_survey_db, mocker, dummy_config):
).all() ).all()
assert len(charging_structures) == 3 assert len(charging_structures) == 3
assert charging_structures[0].nren.name.lower() == 'nren1' assert charging_structures[0].nren.name.lower() == 'nren1'
assert charging_structures[0].fee_type == model_enums.FeeType.no_charge assert charging_structures[0].fee_type == presentation_model_enums.FeeType.no_charge
assert charging_structures[1].nren.name.lower() == 'nren2' assert charging_structures[1].nren.name.lower() == 'nren2'
assert charging_structures[1].fee_type == model_enums.FeeType.usage_based_fee assert charging_structures[1].fee_type == presentation_model_enums.FeeType.usage_based_fee
assert charging_structures[2].nren.name.lower() == 'nren3' assert charging_structures[2].nren.name.lower() == 'nren3'
assert charging_structures[2].fee_type == model_enums.FeeType.other assert charging_structures[2].fee_type == presentation_model_enums.FeeType.other
_ec_data = db.session.scalars( _ec_data = db.session.scalars(
select(presentation_models.ECProject).order_by(presentation_models.ECProject.nren_id.asc()) select(presentation_models.ECProject).order_by(presentation_models.ECProject.nren_id.asc())
......
...@@ -5,7 +5,7 @@ import os ...@@ -5,7 +5,7 @@ import os
from sqlalchemy import func, select from sqlalchemy import func, select
from compendium_v2 import db from compendium_v2 import db
from compendium_v2.db import presentation_models, model_enums from compendium_v2.db import presentation_model_enums, presentation_models
from compendium_v2.publishers.survey_publisher import _map_2023 from compendium_v2.publishers.survey_publisher import _map_2023
...@@ -53,7 +53,7 @@ def test_v2_publisher_full(app): ...@@ -53,7 +53,7 @@ def test_v2_publisher_full(app):
assert funding_source.other == Decimal("10") assert funding_source.other == Decimal("10")
charging_structure = db.session.scalar(select(presentation_models.ChargingStructure.fee_type)) charging_structure = db.session.scalar(select(presentation_models.ChargingStructure.fee_type))
assert charging_structure == model_enums.FeeType.usage_based_fee assert charging_structure == presentation_model_enums.FeeType.usage_based_fee
staff = db.session.scalar(select(presentation_models.NrenStaff)) staff = db.session.scalar(select(presentation_models.NrenStaff))
assert staff.permanent_fte == Decimal("5.6") assert staff.permanent_fte == Decimal("5.6")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment