Skip to content

Commit

Permalink
Fixed test data longer than max_length
Browse files Browse the repository at this point in the history
  • Loading branch information
ddabble committed Feb 19, 2024
1 parent 33b0d50 commit 6c2a396
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions simple_history/tests/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ def test_history_list_contains_diff_changes(self):

def test_history_list_doesnt_contain_too_long_diff_changes(self):
self.login()
poll = Poll(question=f"W{'A' * 200}", pub_date=today)
repeated_chars = Poll._meta.get_field("question").max_length - 1
poll = Poll(question=f"W{'A' * repeated_chars}", pub_date=today)
poll._history_user = self.user
poll.save()
poll.question = f"W{'E' * 200}"
poll.question = f"W{'E' * repeated_chars}"
poll.save()

response = self.client.get(get_history_url(poll))
Expand Down

0 comments on commit 6c2a396

Please sign in to comment.