From 32a285ba8cb931b886fafae86f2e2f32e3ce20ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Mar 2026 16:58:42 +0100 Subject: [PATCH] python313Packages.django-autoslug: fix tests with django_6 --- .../python-modules/django-autoslug/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django-autoslug/default.nix b/pkgs/development/python-modules/django-autoslug/default.nix index c9749a1c90da..119851f3b34a 100644 --- a/pkgs/development/python-modules/django-autoslug/default.nix +++ b/pkgs/development/python-modules/django-autoslug/default.nix @@ -3,7 +3,6 @@ buildPythonPackage, fetchFromGitHub, setuptools, - wheel, django, django-modeltranslation, }: @@ -20,9 +19,15 @@ buildPythonPackage rec { hash = "sha256-IRLY4VaKYXVkSgU/zdY+PSmGrcFB2FlE5L7j0FqisRM="; }; + postPatch = lib.optionalString (lib.versionAtLeast django.version "6.0") '' + # sadly upstream does not use pytest, so we must patch the one failing test or we could not run any tests at all + # see https://github.com/justinmayer/django-autoslug/issues/87 + substituteInPlace autoslug/tests/tests.py \ + --replace-fail "assert b.slug == 'hello_world-2'" "assert b.slug == 'hello_world_2'" + ''; + build-system = [ setuptools - wheel ]; dependencies = [ django ];