Skip to content

[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

Merged

Conversation

stanislawK
Copy link
Contributor

To run tests - get into the running backend container and type pytest

@OtisRed OtisRed requested review from jacekkalbarczyk and w1stler May 8, 2019 19:22
Copy link
Member

@w1stler w1stler left a 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.


@pytest.fixture
def _db():
"""Create and configure a new db instance for pytest-flask-sqlalchemy"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Period at the end.

"""
GIVEN registerd user and app instance
WHEN login with valid user data
THEN check if access token is in response
Copy link
Member

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.

@pytest.fixture
def new_user():
user = {'username': 'TestName',
'password': 'TestPassword'}
Copy link
Member

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.


def test_login_with_invalid_password(client, new_user, registered_user):
"""
GIVEN registred user and app instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo (registered)

@OtisRed
Copy link
Contributor

OtisRed commented Jun 5, 2019

@kristhina review, please (make start, make bash, make test)

Copy link
Member

@kristhina kristhina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests passed

@stanislawK stanislawK merged commit ad0df19 into CodeForPoznan:master Jun 12, 2019
@stanislawK stanislawK deleted the 37_unit_test_for_login_API_endpoint branch June 12, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants