Skip to content

chore: Update test matrix - #398

Merged
fsbraun merged 8 commits into
masterfrom
fix/395-django-61-breadcrumbs
Aug 27, 2026
Merged

chore: Update test matrix#398
fsbraun merged 8 commits into
masterfrom
fix/395-django-61-breadcrumbs

Conversation

@fsbraun

@fsbraun fsbraun commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

Expand compatibility testing to django CMS 5.1 and maintain page usage and form media behavior across newer Django versions.

Bug Fixes:

  • Fix page usage loading with django CMS 5.1 by using the version-aware page content manager during prefetching.

Enhancements:

  • Update the supported framework classifiers and test coverage for django CMS 5.1.
  • Adjust media assertions to remain compatible with Django 6.1 asset representations.

Build:

  • Restructure compiled dependency requirements to test django CMS 5.0 selectively and django CMS 5.1 across the supported Python and Django matrix.

Tests:

  • Update the test matrix and dependency constraints for django CMS 5.1 while removing redundant django CMS 5.0 combinations.

Related resources

  • #...
  • #...

Checklist

fsbraun and others added 5 commits August 27, 2026 16:52
Django 6.1 changed the admin breadcrumbs from `<div class="breadcrumbs">`
to `<ol class="breadcrumbs">` with one `<li>` per crumb, and its selectors
in `admin/css/base.css` are element-qualified. The `{% block breadcrumbs %}`
override in `alias_usage.html` still emitted the old markup, so the
breadcrumbs matched no rule at all and rendered unstyled.

The block now switches on the Django version through a new
`{% django_version_gte %}` template tag: on 6.1+ it emits the list markup
with `aria-current="page"` on the last crumb and without the literal
`&rsaquo;` separators (6.1 generates them from `li::after`), and keeps the
old markup on 5.2/6.0.

Fixes #395

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
Django main requires `asgiref>=3.12.1`, but the djmain lock files still
pinned 3.9.1 / 3.10.0, so `unit-tests-dev` failed to install before it
ever ran a test:

    The conflict is caused by:
        The user requested asgiref==3.9.1
        django 6.2 depends on asgiref>=3.12.1

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
Django 6.1 is released and is what #395 is about, but nothing in the
matrix ran against it - the 6.1 code paths were only exercised by the
`unit-tests-dev` jobs, whose test step is `continue-on-error`.

Adds a `dj61` environment for Python 3.12-3.14 (Django 6.1 needs 3.12+),
the matching lock files, and the trove classifier.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
django CMS 5.1 is released and supported (`django-cms>=5.0`), but the
matrix only ever installed 5.0.x. Adds a `cms51` environment alongside
`cms50` for every Django version in the matrix, the matching lock files,
and the trove classifier.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
django CMS 5.1 now covers the full Python/Django matrix, so 5.0 only
needs the two ends of it: py311-dj52 and py314-dj61. Drops the 16 lock
files in between and takes the matrix from 36 to 24 environments.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
@sourcery-ai

sourcery-ai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the compatibility matrix to include Django 6.1 and django CMS 5.1, while introducing version-specific admin breadcrumb markup so alias usage pages remain correctly styled across supported Django versions; tests cover the new tag and rendering branches.

Sequence diagram for version-specific admin breadcrumb rendering

sequenceDiagram
    participant Template as alias_usage.html
    participant Tag as django_version_gte
    participant Django as Django

    Template->>Tag: django_version_gte(6, 1)
    Tag->>Django: Read django.VERSION
    Django-->>Tag: Version tuple
    Tag-->>Template: True or False
    alt Django 6.1 or newer
        Template->>Template: Render ol.breadcrumbs
    else Django older than 6.1
        Template->>Template: Render div.breadcrumbs
    end
Loading

File-Level Changes

Change Details Files
Added Django-version-aware admin breadcrumb rendering for compatibility with Django 6.1 markup and styling changes.
  • Introduced a template tag for comparing the active Django version.
  • Rendered ordered-list breadcrumbs on Django 6.1+ and retained legacy div breadcrumbs for older versions.
  • Added coverage for the version tag and both breadcrumb markup paths.
djangocms_alias/templates/djangocms_alias/alias_usage.html
djangocms_alias/templatetags/djangocms_alias_tags.py
tests/test_templatetags.py
tests/test_views.py
Expanded and reshaped the supported dependency and test matrix for newer Django CMS and Django releases.
  • Added Django 6.1 and django CMS 5.1 package classifiers and requirement constraints.
  • Updated tox environments so CMS 5.0 is tested only at the boundary combinations while CMS 5.1 covers the broader matrix.
  • Regenerated requirement lock files for the revised Python/Django/CMS combinations and updated main/dev snapshots.
pyproject.toml
tests/requirements/compile.py
tests/requirements/*.txt
tox.ini

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

fsbraun and others added 3 commits August 27, 2026 20:56
#396 and #397 landed upstream in the meantime; #396 was merged before the
matrix was trimmed. Resolved every conflict under tests/requirements/,
tox.ini and compile.py in favour of this branch, so the trimmed matrix
stands: django CMS 5.0 only at py311-dj52 and py314-dj61, django CMS 5.1
across the full Python/Django matrix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
django CMS 5.1 renders `Page.__str__` through `get_admin_content()`, which
reads `self.pagecontent_set(manager="admin_manager").latest_content()`. The
usage list prefetched `pagecontent_set` through the default manager, and a
prefetch lands in `_prefetched_objects_cache` under the relation name no
matter which manager asked for it - so that call got a plain queryset back
and blew up:

    AttributeError: 'QuerySet' object has no attribute 'latest_content'

Prefetching `PageContent.admin_manager.latest_content()` instead keeps the
cache useful and gives django CMS the queryset API it expects.
`admin_manager` and `latest_content()` exist on django CMS 5.0 and 5.1,
with and without djangocms-versioning.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
Django 6.1 stores `Script` objects in `Media._js` instead of plain paths,
so the substring check in the alias plugin media test raised
`TypeError: argument of type 'Script' is not a container or iterable`.
Asserting against the rendered media works on every supported version.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
@fsbraun
fsbraun merged commit 86bd4e3 into master Aug 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant