From 33b0d503df179843f222b7e8f22e32e792622bbd Mon Sep 17 00:00:00 2001 From: Anders <6058745+ddabble@users.noreply.github.com> Date: Mon, 19 Feb 2024 01:01:49 +0100 Subject: [PATCH] Fixed invalid history delta changes test --- simple_history/tests/tests/test_admin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/simple_history/tests/tests/test_admin.py b/simple_history/tests/tests/test_admin.py index 1c7958f1..6ecd2400 100644 --- a/simple_history/tests/tests/test_admin.py +++ b/simple_history/tests/tests/test_admin.py @@ -124,17 +124,17 @@ def test_history_list_contains_diff_changes(self): def test_history_list_doesnt_contain_too_long_diff_changes(self): self.login() - poll = Poll(question="A" * 200, pub_date=today) + poll = Poll(question=f"W{'A' * 200}", pub_date=today) poll._history_user = self.user poll.save() - poll.question = "B" * 200 + poll.question = f"W{'E' * 200}" poll.save() response = self.client.get(get_history_url(poll)) self.assertContains(response, "Question") - expected_num_chars = SimpleHistoryAdmin.max_displayed_history_change_chars - 1 - self.assertContains(response, f"{'A' * expected_num_chars}…") - self.assertContains(response, f"{'B' * expected_num_chars}…") + repeated_chars = SimpleHistoryAdmin.max_displayed_history_change_chars - 2 + self.assertContains(response, f"W{'A' * repeated_chars}…") + self.assertContains(response, f"W{'E' * repeated_chars}…") def test_history_list_custom_fields(self): model_name = self.user._meta.model_name