Skip to content

Commit

Permalink
Fixed invalid history delta changes test
Browse files Browse the repository at this point in the history
  • Loading branch information
ddabble committed Feb 19, 2024
1 parent b983212 commit 33b0d50
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions simple_history/tests/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33b0d50

Please sign in to comment.