-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model: make forward compatible to sqlalchemy >= 2
- Loading branch information
1 parent
baca06c
commit ef17e32
Showing
8 changed files
with
49 additions
and
35 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
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 |
---|---|---|
|
@@ -151,7 +151,9 @@ def test_datastore_usercreate(app): | |
ds.commit() | ||
u2 = ds.find_user(email="[email protected]") | ||
assert u1 == u2 | ||
assert 1 == User.query.filter_by(email="[email protected]").count() | ||
assert ( | ||
1 == db.session.query(User).filter_by(email="[email protected]").count() | ||
) | ||
|
||
|
||
def test_datastore_rolecreate(app): | ||
|
@@ -162,7 +164,7 @@ def test_datastore_rolecreate(app): | |
ds.commit() | ||
r2 = ds.find_role("superuser") | ||
assert r1 == r2 | ||
assert 1 == Role.query.filter_by(name="superuser").count() | ||
assert 1 == db.session.query(Role).filter_by(name="superuser").count() | ||
|
||
|
||
def test_datastore_update_role(app): | ||
|
@@ -173,7 +175,7 @@ def test_datastore_update_role(app): | |
ds.commit() | ||
r2 = ds.find_role("superuser") | ||
assert r1 == r2 | ||
assert 1 == Role.query.filter_by(name="superuser").count() | ||
assert 1 == db.session.query(Role).filter_by(name="superuser").count() | ||
assert r2.is_managed is True | ||
|
||
r1 = ds.update_role( | ||
|
@@ -186,8 +188,8 @@ def test_datastore_update_role(app): | |
assert r1 == r2 | ||
assert r2.description == "updated description" | ||
assert r2.is_managed is False | ||
assert 1 == Role.query.filter_by(name="megauser").count() | ||
assert 0 == Role.query.filter_by(name="superuser").count() | ||
assert 1 == db.session.query(Role).filter_by(name="megauser").count() | ||
assert 0 == db.session.query(Role).filter_by(name="superuser").count() | ||
|
||
|
||
def test_datastore_assignrole(app): | ||
|
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