Skip to content
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

test: Create test_authentication.py. Implemented comprehensive test s… #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nwekealex65
Copy link
Owner

@nwekealex65 nwekealex65 commented Mar 29, 2024

What does this PR do?

This PR implements a comprehensive test suite for the OsmAuthentication class. The test suite covers various scenarios such as successful authentication with a valid access token, authentication failure due to exceptions during authentication, and cases where no access token is provided or the user does not exist in the database. This enhancement aims to improve the reliability and maintainability of the authentication functionality within the Django backend.

Backend functionality worked on: Authentication

Issue Link: Link to the corresponding issue

This PR resolve issue hotosm#229

Consideration:

While developing this PR, the following considerations were taken into account:

Ensuring test coverage for critical authentication scenarios.
Utilizing mocking to isolate the functionality being tested.
Adhering to the Black formatter for code consistency.

How to test?

To test the changes introduced in this PR, run the following command:

python manage.py test tests.test_authentication.py

Alternatively, you can run all tests by simply using:

python manage.py test

…uite for OsmAuthentication

This commit introduces a new test case suite for the OsmAuthentication class. The test suite covers various scenarios including successful authentication with a valid access token, authentication failure due to exceptions during authentication, and cases where no access token is provided or the user does not exist in the database. Each test case is well-documented, providing clarity on its purpose and methodology. Additionally, appropriate mocking is utilized to simulate dependencies and ensure isolated testing. This comprehensive test suite enhances the reliability and maintainability of the authentication functionality within the Django backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant