--- Begin Message ---
Source: django-oauth-toolkit
Version: 1.7.0-2
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20230925 ftbfs-trixie
Hi,
During a rebuild of all packages in sid, your package failed to build
on amd64.
Relevant part (hopefully):
> debian/rules binary
> dh binary --with python3 --buildsystem=pybuild
> dh_update_autotools_config -O--buildsystem=pybuild
> dh_autoreconf -O--buildsystem=pybuild
> dh_auto_configure -O--buildsystem=pybuild
> I: pybuild base:291: python3.11 setup.py config
> running config
> dh_auto_build -O--buildsystem=pybuild
> I: pybuild base:291: /usr/bin/python3 setup.py build
> running build
> running build_py
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/decorators.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/middleware.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/tasks.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/apps.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/oauth2_validators.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/oauth2_backends.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/exceptions.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/urls.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/admin.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/generators.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/backends.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/http.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/compat.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/models.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/settings.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/signals.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/scopes.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/forms.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> copying oauth2_provider/validators.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> copying oauth2_provider/migrations/0003_auto_20201211_1314.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> copying oauth2_provider/migrations/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> copying oauth2_provider/migrations/0005_auto_20211222_2352.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> copying oauth2_provider/migrations/0001_initial.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> copying oauth2_provider/migrations/0002_auto_20190406_1805.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> copying oauth2_provider/migrations/0004_auto_20200902_2022.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/migrations
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/contrib
> copying oauth2_provider/contrib/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/contrib
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/generic.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/base.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/introspect.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/application.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/token.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/mixins.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> copying oauth2_provider/views/oidc.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/views
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/management
> copying oauth2_provider/management/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/management
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/contrib/rest_framework
> copying oauth2_provider/contrib/rest_framework/permissions.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/contrib/rest_framework
> copying oauth2_provider/contrib/rest_framework/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/contrib/rest_framework
> copying oauth2_provider/contrib/rest_framework/authentication.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/contrib/rest_framework
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/management/commands
> copying oauth2_provider/management/commands/createapplication.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/management/commands
> copying oauth2_provider/management/commands/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/management/commands
> copying oauth2_provider/management/commands/cleartokens.py ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/management/commands
> running egg_info
> creating django_oauth_toolkit.egg-info
> writing django_oauth_toolkit.egg-info/PKG-INFO
> writing dependency_links to django_oauth_toolkit.egg-info/dependency_links.txt
> writing requirements to django_oauth_toolkit.egg-info/requires.txt
> writing top-level names to django_oauth_toolkit.egg-info/top_level.txt
> writing manifest file 'django_oauth_toolkit.egg-info/SOURCES.txt'
> reading manifest file 'django_oauth_toolkit.egg-info/SOURCES.txt'
> reading manifest template 'MANIFEST.in'
> adding license file 'LICENSE'
> adding license file 'AUTHORS'
> writing manifest file 'django_oauth_toolkit.egg-info/SOURCES.txt'
> /usr/lib/python3/dist-packages/setuptools/command/build_py.py:204: _Warning:
> Package 'oauth2_provider.templates.oauth2_provider' is absent from the
> `packages` configuration.
> !!
>
>
> ********************************************************************************
> ############################
> # Package would be ignored #
> ############################
> Python recognizes 'oauth2_provider.templates.oauth2_provider' as an
> importable package[^1],
> but it is absent from setuptools' `packages` configuration.
>
> This leads to an ambiguous overall configuration. If you want to
> distribute this
> package, please make sure that
> 'oauth2_provider.templates.oauth2_provider' is explicitly added
> to the `packages` configuration field.
>
> Alternatively, you can also rely on setuptools' discovery methods
> (for example by using `find_namespace_packages(...)`/`find_namespace:`
> instead of `find_packages(...)`/`find:`).
>
> You can read more about "package discovery" on setuptools
> documentation page:
>
> -
> https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
>
> If you don't want 'oauth2_provider.templates.oauth2_provider' to be
> distributed and are
> already explicitly excluding
> 'oauth2_provider.templates.oauth2_provider' via
> `find_namespace_packages(...)/find_namespace` or
> `find_packages(...)/find`,
> you can try to use `exclude_package_data`, or
> `include-package-data=False` in
> combination with a more fine grained `package-data` configuration.
>
> You can read more about "package data files" on setuptools
> documentation page:
>
> - https://setuptools.pypa.io/en/latest/userguide/datafiles.html
>
>
> [^1]: For Python, any directory (with suitable naming) can be
> imported,
> even if it does not contain any `.py` files.
> On the other hand, currently there is no concept of package data
> directory, all directories are treated like packages.
>
> ********************************************************************************
>
> !!
> check.warn(importable)
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates
> creating
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying
> oauth2_provider/templates/oauth2_provider/application_confirm_delete.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/application_detail.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/application_form.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/application_list.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying
> oauth2_provider/templates/oauth2_provider/application_registration_form.html
> ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/authorize.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/authorized-oob.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying
> oauth2_provider/templates/oauth2_provider/authorized-token-delete.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/authorized-tokens.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> copying oauth2_provider/templates/oauth2_provider/base.html ->
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/oauth2_provider/templates/oauth2_provider
> dh_auto_test -O--buildsystem=pybuild
> I: pybuild base:291: cd
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build;
> python3.11 -m pytest --ds tests.settings
> ============================= test session starts
> ==============================
> platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
> django: settings: tests.settings (from option)
> rootdir: /<<PKGBUILDDIR>>
> configfile: tox.ini
> plugins: mock-3.11.1, cov-4.1.0, xdist-3.3.1, django-4.5.2
> collected 378 items
>
> tests/test_application_views.py .....
> tests/test_auth_backends.py ..........
> tests/test_authorization_code.py
> ..................................................................
> tests/test_client_credential.py .......
> tests/test_commands.py New application created successfully
> .New application created successfully
> .New application created successfully
> .New application created successfully
> .New application created successfully
> ..New application created successfully
> ...
> tests/test_decorators.py ...
> tests/test_generator.py ...
> tests/test_hybrid.py ....................................................
> tests/test_implicit.py ..................
> tests/test_introspection_auth.py ......
> tests/test_introspection_view.py ..............
> tests/test_mixins.py ........
> tests/test_models.py ........................FFF...
> tests/test_oauth2_backends.py ......
> tests/test_oauth2_validators.py s...
> tests/test_oidc_views.py ...........
> tests/test_password.py ...
> tests/test_rest_framework.py ..............................
> tests/test_scopes.py ............
> tests/test_settings.py ...........
> tests/test_token_revocation.py .......
> tests/test_token_view.py ..........
> tests/test_validators.py ...
> tests/test_oauth2_validators.py ..........................
> tests/test_mixins.py ...
> tests/test_oauth2_backends.py .....
> tests/test_oauth2_validators.py ....
> tests/test_scopes_backend.py ..
> tests/test_settings.py ..........
>
> =================================== FAILURES
> ===================================
> __________________ TestClearExpired.test_clear_expired_tokens
> __________________
>
> self = <tests.test_models.TestClearExpired
> testMethod=test_clear_expired_tokens>
>
> def setUp(self):
> super().setUp()
> # Insert many tokens, both expired and not, and grants.
> self.num_tokens = 100
> now = timezone.now()
> earlier = now - timedelta(seconds=100)
> later = now + timedelta(seconds=100)
> app = Application.objects.create(
> name="test_app",
> redirect_uris="http://localhost http://example.com
> http://example.org",
> user=self.user,
> client_type=Application.CLIENT_CONFIDENTIAL,
> authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE,
> )
> # make 200 access tokens, half current and half expired.
> expired_access_tokens = AccessToken.objects.bulk_create(
> AccessToken(token="expired AccessToken {}".format(i),
> expires=earlier)
> for i in range(self.num_tokens)
> )
> current_access_tokens = AccessToken.objects.bulk_create(
> AccessToken(token=f"current AccessToken {i}", expires=later) for
> i in range(self.num_tokens)
> )
> # Give the first half of the access tokens a refresh token,
> # alternating between current and expired ones.
> > RefreshToken.objects.bulk_create(
> RefreshToken(
> token=f"expired AT's refresh token {i}",
> application=app,
> access_token=expired_access_tokens[i].pk,
> user=self.user,
> )
> for i in range(0, len(expired_access_tokens) // 2, 2)
> )
>
> tests/test_models.py:321:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
> /usr/lib/python3/dist-packages/django/db/models/manager.py:87: in
> manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
> /usr/lib/python3/dist-packages/django/db/models/query.py:781: in bulk_create
> objs = list(objs)
> tests/test_models.py:322: in <genexpr>
> RefreshToken(
> /usr/lib/python3/dist-packages/django/db/models/base.py:543: in __init__
> _setattr(self, field.name, rel_obj)
> /usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py:369:
> in __set__
> super().__set__(instance, value)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
>
> self = <django.db.models.fields.related_descriptors.ForwardOneToOneDescriptor
> object at 0x7ff41ca0df50>
> instance = <RefreshToken: expired AT's refresh token 0>, value = 1
>
> def __set__(self, instance, value):
> """
> Set the related instance through the forward relation.
>
> With the example above, when setting ``child.parent = parent``:
>
> - ``self`` is the descriptor managing the ``parent`` attribute
> - ``instance`` is the ``child`` instance
> - ``value`` is the ``parent`` instance on the right of the equal sign
> """
> # An object must be an instance of the related class.
> if value is not None and not isinstance(
> value, self.field.remote_field.model._meta.concrete_model
> ):
> > raise ValueError(
> 'Cannot assign "%r": "%s.%s" must be a "%s" instance.'
> % (
> value,
> instance._meta.object_name,
> self.field.name,
> self.field.remote_field.model._meta.object_name,
> )
> E ValueError: Cannot assign "1": "RefreshToken.access_token"
> must be a "AccessToken" instance.
>
> /usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py:266:
> ValueError
> _________ TestClearExpired.test_clear_expired_tokens_incorect_timetype
> _________
>
> self = <tests.test_models.TestClearExpired
> testMethod=test_clear_expired_tokens_incorect_timetype>
>
> def setUp(self):
> super().setUp()
> # Insert many tokens, both expired and not, and grants.
> self.num_tokens = 100
> now = timezone.now()
> earlier = now - timedelta(seconds=100)
> later = now + timedelta(seconds=100)
> app = Application.objects.create(
> name="test_app",
> redirect_uris="http://localhost http://example.com
> http://example.org",
> user=self.user,
> client_type=Application.CLIENT_CONFIDENTIAL,
> authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE,
> )
> # make 200 access tokens, half current and half expired.
> expired_access_tokens = AccessToken.objects.bulk_create(
> AccessToken(token="expired AccessToken {}".format(i),
> expires=earlier)
> for i in range(self.num_tokens)
> )
> current_access_tokens = AccessToken.objects.bulk_create(
> AccessToken(token=f"current AccessToken {i}", expires=later) for
> i in range(self.num_tokens)
> )
> # Give the first half of the access tokens a refresh token,
> # alternating between current and expired ones.
> > RefreshToken.objects.bulk_create(
> RefreshToken(
> token=f"expired AT's refresh token {i}",
> application=app,
> access_token=expired_access_tokens[i].pk,
> user=self.user,
> )
> for i in range(0, len(expired_access_tokens) // 2, 2)
> )
>
> tests/test_models.py:321:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
> /usr/lib/python3/dist-packages/django/db/models/manager.py:87: in
> manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
> /usr/lib/python3/dist-packages/django/db/models/query.py:781: in bulk_create
> objs = list(objs)
> tests/test_models.py:322: in <genexpr>
> RefreshToken(
> /usr/lib/python3/dist-packages/django/db/models/base.py:543: in __init__
> _setattr(self, field.name, rel_obj)
> /usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py:369:
> in __set__
> super().__set__(instance, value)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
>
> self = <django.db.models.fields.related_descriptors.ForwardOneToOneDescriptor
> object at 0x7ff41ca0df50>
> instance = <RefreshToken: expired AT's refresh token 0>, value = 1
>
> def __set__(self, instance, value):
> """
> Set the related instance through the forward relation.
>
> With the example above, when setting ``child.parent = parent``:
>
> - ``self`` is the descriptor managing the ``parent`` attribute
> - ``instance`` is the ``child`` instance
> - ``value`` is the ``parent`` instance on the right of the equal sign
> """
> # An object must be an instance of the related class.
> if value is not None and not isinstance(
> value, self.field.remote_field.model._meta.concrete_model
> ):
> > raise ValueError(
> 'Cannot assign "%r": "%s.%s" must be a "%s" instance.'
> % (
> value,
> instance._meta.object_name,
> self.field.name,
> self.field.remote_field.model._meta.object_name,
> )
> E ValueError: Cannot assign "1": "RefreshToken.access_token"
> must be a "AccessToken" instance.
>
> /usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py:266:
> ValueError
> ____________ TestClearExpired.test_clear_expired_tokens_with_tokens
> ____________
>
> self = <tests.test_models.TestClearExpired
> testMethod=test_clear_expired_tokens_with_tokens>
>
> def setUp(self):
> super().setUp()
> # Insert many tokens, both expired and not, and grants.
> self.num_tokens = 100
> now = timezone.now()
> earlier = now - timedelta(seconds=100)
> later = now + timedelta(seconds=100)
> app = Application.objects.create(
> name="test_app",
> redirect_uris="http://localhost http://example.com
> http://example.org",
> user=self.user,
> client_type=Application.CLIENT_CONFIDENTIAL,
> authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE,
> )
> # make 200 access tokens, half current and half expired.
> expired_access_tokens = AccessToken.objects.bulk_create(
> AccessToken(token="expired AccessToken {}".format(i),
> expires=earlier)
> for i in range(self.num_tokens)
> )
> current_access_tokens = AccessToken.objects.bulk_create(
> AccessToken(token=f"current AccessToken {i}", expires=later) for
> i in range(self.num_tokens)
> )
> # Give the first half of the access tokens a refresh token,
> # alternating between current and expired ones.
> > RefreshToken.objects.bulk_create(
> RefreshToken(
> token=f"expired AT's refresh token {i}",
> application=app,
> access_token=expired_access_tokens[i].pk,
> user=self.user,
> )
> for i in range(0, len(expired_access_tokens) // 2, 2)
> )
>
> tests/test_models.py:321:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
> /usr/lib/python3/dist-packages/django/db/models/manager.py:87: in
> manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
> /usr/lib/python3/dist-packages/django/db/models/query.py:781: in bulk_create
> objs = list(objs)
> tests/test_models.py:322: in <genexpr>
> RefreshToken(
> /usr/lib/python3/dist-packages/django/db/models/base.py:543: in __init__
> _setattr(self, field.name, rel_obj)
> /usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py:369:
> in __set__
> super().__set__(instance, value)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
>
> self = <django.db.models.fields.related_descriptors.ForwardOneToOneDescriptor
> object at 0x7ff41ca0df50>
> instance = <RefreshToken: expired AT's refresh token 0>, value = 1
>
> def __set__(self, instance, value):
> """
> Set the related instance through the forward relation.
>
> With the example above, when setting ``child.parent = parent``:
>
> - ``self`` is the descriptor managing the ``parent`` attribute
> - ``instance`` is the ``child`` instance
> - ``value`` is the ``parent`` instance on the right of the equal sign
> """
> # An object must be an instance of the related class.
> if value is not None and not isinstance(
> value, self.field.remote_field.model._meta.concrete_model
> ):
> > raise ValueError(
> 'Cannot assign "%r": "%s.%s" must be a "%s" instance.'
> % (
> value,
> instance._meta.object_name,
> self.field.name,
> self.field.remote_field.model._meta.object_name,
> )
> E ValueError: Cannot assign "1": "RefreshToken.access_token"
> must be a "AccessToken" instance.
>
> /usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py:266:
> ValueError
> =============================== warnings summary
> ===============================
> ../../../../../../usr/lib/python3/dist-packages/django/conf/__init__.py:267
> /usr/lib/python3/dist-packages/django/conf/__init__.py:267:
> RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with
> Django 5.0, localized formatting of data will always be enabled. For example
> Django will display numbers and dates using the format of the current locale.
> warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)
>
> tests/test_client_credential.py:106
>
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_client_credential.py:106:
> PytestCollectionWarning: cannot collect test class 'TestView' because it has
> a __init__ constructor (from:
> .pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_client_credential.py)
> class TestView(OAuthLibMixin, View):
>
> .pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_authorization_code.py::TestOIDCAuthorizationCodeHSAlgorithm::test_id_token
>
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_authorization_code.py:1734:
> DeprecationWarning: Call to deprecated function (or staticmethod) key_type.
> assert key.key_type == "oct"
>
> .pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_models.py::test_application_key
>
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_models.py:430:
> DeprecationWarning: Call to deprecated function (or staticmethod) key_type.
> assert key.key_type == "RSA"
>
> .pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_models.py::test_application_key
>
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build/tests/test_models.py:441:
> DeprecationWarning: Call to deprecated function (or staticmethod) key_type.
> assert key.key_type == "oct"
>
> -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
> =========================== short test summary info
> ============================
> FAILED tests/test_models.py::TestClearExpired::test_clear_expired_tokens -
> Va...
> FAILED
> tests/test_models.py::TestClearExpired::test_clear_expired_tokens_incorect_timetype
> FAILED
> tests/test_models.py::TestClearExpired::test_clear_expired_tokens_with_tokens
> ======= 3 failed, 374 passed, 1 skipped, 5 warnings in 306.51s (0:05:06)
> =======
> E: pybuild pybuild:395: test: plugin distutils failed with: exit code=1: cd
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_django-oauth-toolkit/build;
> python3.11 -m pytest --ds tests.settings
> dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.11
> returned exit code 13
The full build log is available from:
http://qa-logs.debian.net/2023/09/25/django-oauth-toolkit_1.7.0-2_unstable.log
All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20230925;users=lu...@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20230925&fusertaguser=lu...@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results
A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects
If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.
--- End Message ---