jazzband / django-oauth-toolkit

OAuth2 goodies for the Djangonauts!
https://django-oauth-toolkit.readthedocs.io
Other
3.16k stars 794 forks source link

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

Open n2ygk opened 2 months ago

n2ygk commented 2 months ago

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

Additional context

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

n2ygk commented 2 months ago

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"])