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

DeprecationWarning in test_authorization_code.py::TestOIDCAuthorizationCodeHSAlgorithm::test_id_token #1483

Open
1 of 2 tasks
n2ygk opened this issue Sep 5, 2024 · 1 comment

Comments

@n2ygk
Copy link
Member

n2ygk commented Sep 5, 2024

Describe the bug

DeprecationWarning is raised.

================================================================ warnings summary =================================================================
tests/test_authorization_code.py::TestOIDCAuthorizationCodeHSAlgorithm::test_id_token
  /Users/ac45/src/django-oauth-toolkit/tests/test_authorization_code.py:1870: DeprecationWarning: 
    assert key.key_type == "oct"

tests/test_models.py::test_application_key
  /Users/ac45/src/django-oauth-toolkit/tests/test_models.py:549: DeprecationWarning: 
    assert key.key_type == "RSA"

tests/test_models.py::test_application_key
  /Users/ac45/src/django-oauth-toolkit/tests/test_models.py:560: DeprecationWarning: 
    assert key.key_type == "oct"

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

To Reproduce

tox -e py38-dj42

Expected behavior

Should not have DeprecationWarnings

Version

  • I have tested with the latest published release and it's still a problem.
  • I have tested with the master branch and it's still a problem.

Additional context

Will need to identify the specific Deprecation and refactor as needed.

@n2ygk n2ygk added the bug label Sep 5, 2024
@n2ygk
Copy link
Member Author

n2ygk commented Sep 5, 2024

See also py312-dj41 etc. which raises this additional DeprecationWarning related to python 3.12:

tests/test_introspection_auth.py: 10 warnings
  /Users/ac45/src/django-oauth-toolkit/oauth2_provider/oauth2_validators.py:412: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    expires = datetime.utcfromtimestamp(content["exp"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant