Skip to content

Commit

Permalink
boxine#27 change overlong desc testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrattoune authored Mar 30, 2022
1 parent fd1e29c commit 85bdc65
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions huey_monitor_tests/tests/test_tqdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ def test_process_description_overlong(self):
]

# Overlong description should be cut:
msg = f'["Process info description overlong: \'{overlong_txt}\'"]'
with self.assertRaisesMessage(ValidationError, msg):
with self.assertLogs('huey_monitor.tqdm') as logs:
ProcessInfo(task, desc=overlong_txt, total=999)
instance = TaskModel.objects.get()
assert instance.desc == max_length_txt

assert logs.output == [
(
'INFO:huey_monitor.tqdm:Init TaskModel Task'
f' - {max_length_txt} 0/999 (divisor: 1000)'
)
]

0 comments on commit 85bdc65

Please sign in to comment.