Skip to content

Commit

Permalink
fix bad db import
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Dec 19, 2023
1 parent b9f8ad0 commit f8b5c05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pypnusershub/tests/test_utilisateurs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def test_insert_organisme(self):
assert organism_as_dict["nom_organisme"] == "update"

def test_filter_by_app(self, group_and_users):
roles = select(User).where(User.filter_by_app("APPLI_1")).all()
roles = db.session.scalars(
select(User).where(User.filter_by_app("APPLI_1"))
).all()
assert set([group_and_users["group1"], group_and_users["user1"]]).issubset(
roles
)
Expand Down
2 changes: 1 addition & 1 deletion src/pypnusershub/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pypnusershub.utils import get_current_app_id
from pypnusershub.db.models import User
from pypnusershub.db.tools import user_to_token
from geonature.utils.env import db
from pypnusershub.env import db


def set_logged_user(client, user):
Expand Down

0 comments on commit f8b5c05

Please sign in to comment.