Package: django-rich
Followup-For: Bug #1030305
User: [email protected]
Usertags: origin-ubuntu lunar ubuntu-patch
Control: tags -1 patch

Hi, 

The patch was merged upstream after receiving some modifications.

I'm attaching an updated debdiff which backports the patch applied
upstream.

Best regards,
diff -Nru 
django-rich-1.4.0/debian/patches/0001-Fix-failing-tests-if-the-TERM-variable-is-set-to-unk.patch
 
django-rich-1.4.0/debian/patches/0001-Fix-failing-tests-if-the-TERM-variable-is-set-to-unk.patch
--- 
django-rich-1.4.0/debian/patches/0001-Fix-failing-tests-if-the-TERM-variable-is-set-to-unk.patch
    1970-01-01 01:00:00.000000000 +0100
+++ 
django-rich-1.4.0/debian/patches/0001-Fix-failing-tests-if-the-TERM-variable-is-set-to-unk.patch
    2023-02-02 12:05:10.000000000 +0100
@@ -0,0 +1,57 @@
+Description: Fix failing tests if the TERM variable is set to unknown
+Origin: upstream, 
https://github.com/adamchainz/django-rich/commit/d437e9248322540b976d25f8a78a413e581c5dac
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030305
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/django-rich/+bug/2004553
+Applied-Upstream: django-rich >> 1.4.0
+Last-Update: 2023-02-03
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: django-rich-1.4.0/tests/test_management.py
+===================================================================
+--- django-rich-1.4.0.orig/tests/test_management.py    2023-02-03 
09:25:32.460627256 +0100
++++ django-rich-1.4.0/tests/test_management.py 2023-02-03 09:28:26.431930919 
+0100
+@@ -1,12 +1,16 @@
+ from __future__ import annotations
+ 
++import os
+ from functools import partial
+ from inspect import Parameter, Signature, signature
+ from io import StringIO
++from typing import Any
+ from unittest import mock
+ 
+ import pytest
+-from django.core.management import BaseCommand, CommandError, call_command
++from django.core.management import BaseCommand
++from django.core.management import call_command as base_call_command
++from django.core.management import CommandError
+ from django.test import SimpleTestCase
+ from rich.console import Console
+ 
+@@ -28,6 +32,12 @@
+         return True
+ 
+ 
++def call_command(*args: str, **kwargs: Any) -> None:
++    # Ensure rich uses colouring and consistent width
++    with mock.patch.dict(os.environ, TERM="", COLUMNS="80"):
++        base_call_command(*args, **kwargs)
++
++
+ class RichCommandTests(SimpleTestCase):
+     def test_init_signature(self):
+         rc_signature = strip_annotations(signature(RichCommand.__init__))
+Index: django-rich-1.4.0/tests/test_test.py
+===================================================================
+--- django-rich-1.4.0.orig/tests/test_test.py  2023-02-03 09:25:32.460627256 
+0100
++++ django-rich-1.4.0/tests/test_test.py       2023-02-03 09:25:32.460627256 
+0100
+@@ -88,6 +88,9 @@
+                 **os.environ,
+                 "DJANGO_SETTINGS_MODULE": "tests.settings",
+                 "COVERAGE_PROCESS_START": str(SETUP_CFG_PATH),
++                # Ensure rich uses colouring and consistent width
++                "TERM": "",
++                "COLUMNS": "80",
+             },
+             **kwargs,
+         )
diff -Nru django-rich-1.4.0/debian/patches/series 
django-rich-1.4.0/debian/patches/series
--- django-rich-1.4.0/debian/patches/series     2023-01-15 08:16:57.000000000 
+0100
+++ django-rich-1.4.0/debian/patches/series     2023-02-02 12:05:10.000000000 
+0100
@@ -1,3 +1,4 @@
 Use-python3-within-test-call.patch
 tests-Drop-various-python-version-handling.patch
 tests-Another-bunch-of-adoptions-for-Python-3.11.patch
+0001-Fix-failing-tests-if-the-TERM-variable-is-set-to-unk.patch

Reply via email to