-
Notifications
You must be signed in to change notification settings - Fork 45
[37] unit test for login api endpoint #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[37] unit test for login api endpoint #38
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall ok, just formatting stuff.
backend/tests/conftest.py
Outdated
|
||
@pytest.fixture | ||
def _db(): | ||
"""Create and configure a new db instance for pytest-flask-sqlalchemy""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period at the end.
backend/tests/test_login.py
Outdated
""" | ||
GIVEN registerd user and app instance | ||
WHEN login with valid user data | ||
THEN check if access token is in response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in the previous PR.
backend/tests/conftest.py
Outdated
@pytest.fixture | ||
def new_user(): | ||
user = {'username': 'TestName', | ||
'password': 'TestPassword'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this indentation.
backend/tests/test_login.py
Outdated
|
||
def test_login_with_invalid_password(client, new_user, registered_user): | ||
""" | ||
GIVEN registred user and app instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo (registered)
@kristhina review, please (make start, make bash, make test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests passed
To run tests - get into the running backend container and type pytest