python313Packages.django-autoslug: fix tests with django_6

This commit is contained in:
Sandro Jäckel
2026-03-06 16:58:42 +01:00
parent c17f09a1ce
commit 32a285ba8c
@@ -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 ];