user [email protected]
usertags 1146296 python3.15
tags 1146296 patch
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].

It can be solved by adding upstream commit 3678fb1: fix: unbreak CI
against pytest-django 4.14 and Django 6.1 (#1813) [2].

I've applied this fix in the sandbox [2] to verify that it builds
successfully, it should be applied in Debian to get the package back to
a healthy state.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4546439/
[2]: 
https://github.com/django-oauth/django-oauth-toolkit/commit/3678fb1979140b552835c2ef024a67c7bf3f9cbc
[3]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
From: Darrel O'Pry <[email protected]>
Date: Thu, 20 Aug 2026 16:06:05 -0400
Subject: fix: unbreak CI against pytest-django 4.14 and Django 6.1 (#1813)

* test: support the pytest-django 4.14 settings fixture API

pytest-django 4.14 renamed the `settings` fixture's `SettingsWrapper` to
`Settings` and its `finalize()` method to `_finalize()`. The test suite is
installed against unpinned test dependencies, so every job now picks up 4.14
and `OAuthSettingsWrapper.finalize()` falls through to the Django settings
object, raising AttributeError at teardown of every test that uses the
`oauth2_settings` fixture (~736 errors per cell, plus a cascading failure in
`test_checks_fail_when_router_crosses_databases` from settings overrides that
are never disabled).

Call `_finalize()` when the fixture object provides it and fall back to
`finalize()` otherwise, so the suite runs on both pytest-django 4.14 and
earlier releases.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017m1dpRYGScha2uf7badQyz

* fix(checks): keep the token-database check running on Django 6.1

Django 6.1 stopped running `database`-tagged system checks unless a database alias
is passed explicitly (`manage.py check --database default`), on the grounds that
such checks may do more than static analysis. `validate_token_configuration` only
asks the configured routers where the AccessToken/IDToken/RefreshToken models would
be written and never opens a connection, so under the `database` tag a plain
`manage.py check` silently stopped reporting a cross-database token configuration.

Register it under the `models` tag instead -- the same tag as the sibling
`validate_swapped_model_consistency` check -- and assert the tag in the tests so it
cannot regress.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017m1dpRYGScha2uf7badQyz

---------

Co-authored-by: Claude <[email protected]>
---
 tests/conftest.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index 2510025..c039b21 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -57,7 +57,10 @@ class OAuthSettingsWrapper:
         return getattr(_oauth2_settings, attr)
 
     def finalize(self):
-        self.settings.finalize()
+        # pytest-django 4.14 renamed the settings fixture's SettingsWrapper.finalize()
+        # to Settings._finalize(); support both so the suite runs on either version.
+        finalize = getattr(self.settings, "_finalize", None) or self.settings.finalize
+        finalize()
         _oauth2_settings.reload()
 
 

Attachment: signature.asc
Description: PGP signature

Reply via email to