Skip to content

Commit

Permalink
test(variant): correct unit test (foreign key constraint)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Nov 14, 2023
1 parent 2be18ed commit 4688b73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/variantstudy/model/test_variant_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from antarest.core.requests import RequestParameters
from antarest.core.roles import RoleType
from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware, db
from antarest.login.model import User
from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy, StudyAdditionalData
from antarest.study.storage.variantstudy.command_factory import CommandFactory
from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy
Expand Down Expand Up @@ -52,6 +53,9 @@ def test_commands_service(tmp_path: Path, db_engine: Engine, command_factory: Co
)

with db():
# Add the admin user in the database
db.session.add(User(id=SADMIN.user.id))

# sourcery skip: extract-method, inline-variable
# Save a study
origin_id = "origin-id"
Expand Down

0 comments on commit 4688b73

Please sign in to comment.