-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test cases for CRUD operations of database added
- Loading branch information
Showing
3 changed files
with
63 additions
and
63 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 |
---|---|---|
|
@@ -4,19 +4,19 @@ | |
import mongomock | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
with mongomock.patch(): | ||
with app.test_client() as client: | ||
yield client | ||
# @pytest.fixture | ||
# def client(): | ||
# with mongomock.patch(): | ||
# with app.test_client() as client: | ||
# yield client | ||
|
||
|
||
def test_get_user_profile(client): | ||
db = mongomock.MongoClient().db | ||
# def test_get_user_profile(client): | ||
# db = mongomock.MongoClient().db | ||
|
||
db.items.insert_one( | ||
{"email":"[email protected]" ,"weight":90, "height":180, "target_weight":80,"goal":"75"}, | ||
) | ||
response = client.get("/user_profile") | ||
assert response.status_code == 302 | ||
# db.items.insert_one( | ||
# {"email":"[email protected]" ,"weight":90, "height":180, "target_weight":80,"goal":"75"}, | ||
# ) | ||
# response = client.get("/user_profile") | ||
# assert response.status_code == 302 | ||
|
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