freeleaps-authentication/tests/api_tests/siginin
2025-10-30 11:26:05 +08:00
..
${CODEBASE_ROOT}/log init 2025-10-30 11:26:05 +08:00
log init 2025-10-30 11:26:05 +08:00
__init__.py init 2025-10-30 11:26:05 +08:00
config.py init 2025-10-30 11:26:05 +08:00
conftest.py init 2025-10-30 11:26:05 +08:00
README.md init 2025-10-30 11:26:05 +08:00
test_signin_with_email_and_password.py init 2025-10-30 11:26:05 +08:00

Signin API Test Report

How to Run the Tests

Run all signin API tests:

pytest --tb=short tests/api_tests/siginin/

Test Results Summary

  • Total tests collected: 1
  • All tests passed.
  • Warnings:
    • Deprecation warning from Pydantic (upgrade recommended for future compatibility).

Test Case Explanations

test_signin_with_email_and_password.py

  • test_sign_in_with_email_and_password
    This test verifies the email and password sign-in flow:
    • Calls the login API with valid credentials.
    • Asserts that the response contains a valid access token, refresh token, expiration, identity, role names, and user permissions.
    • Decodes the JWT access token and checks that the payload contains the expected subject fields (id, role_names, user_permissions).

Summary

  • This test ensures that the email/password sign-in API returns all required authentication and user information fields, and that the JWT token is correctly structured.
  • If you need to add more signin scenarios, add new test cases to this directory and re-run the tests.