From d68430349e3cb124946e4eb1da664e0e01fc90bd Mon Sep 17 00:00:00 2001 From: Keerthi Vasan Date: Sun, 23 Jun 2024 20:55:26 +0530 Subject: [PATCH] chore: fix debug tests --- django/utils/text.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/django/utils/text.py b/django/utils/text.py index 5e061f22d1..c32b0677cf 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -520,9 +520,12 @@ class DebugRepr(reprlib.Repr): return s def print(self, value): - if isinstance(value, Sized) and len(value) > self.limit: + if isinstance(value, Sized): length = len(value) - self.fillvalue = self.gen_trim_msg(length) + if length > self.limit: + self.fillvalue = self.gen_trim_msg(length) + else: + self.fillvalue = "" else: self.fillvalue = "..." return self.repr(value)