Skip to content

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

@n2ygk

Description

@n2ygk
Contributor

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.

Activity

n2ygk

n2ygk commented on Sep 5, 2024

@n2ygk
ContributorAuthor

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

Subham-KRLX commented on Aug 9, 2025

@Subham-KRLX
Contributor

I would like to fix this please assign this issue to me.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @n2ygk@Subham-KRLX

      Issue actions

        DeprecationWarning in test_authorization_code.py::TestOIDCAuthorizationCodeHSAlgorithm::test_id_token · Issue #1483 · django-oauth/django-oauth-toolkit