-
Notifications
You must be signed in to change notification settings - Fork 965
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tell warehouse.db to reuse db_session test fixture
- Loading branch information
1 parent
0097571
commit 9957047
Showing
3 changed files
with
48 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
from tests.common.db.accounts import UserFactory | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from sqlalchemy import text | ||
|
||
def test_user_profile(db_session, webtest): | ||
from tests.common.db.accounts import UserFactory | ||
|
||
|
||
def test_user_profile(webtest, db_session): | ||
user = UserFactory.create() | ||
assert user.username | ||
print(f"got user {user.username}", flush=True) | ||
result = db_session.execute(text("select * from users")) | ||
actual = ["; ".join([f"{s}" for s in row]) for row in result] | ||
print(actual, flush=True) | ||
# vist user's page | ||
# visit user's page | ||
resp = webtest.get(f"/user/{user.username}/") | ||
assert resp.status_code == 200 |
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