Commit 067dfc9
Fix test_database AttributeError on ignore_result with Celery 5.x
The protocol 1 test requests are built via hybrid_to_proto2() which does
not include 'ignore_result' in the message headers. Celery 5.x's
Request.__init__ reads 'ignore_result' from the headers and, when absent,
falls back to self._task.ignore_result. Since these tests pass the task
name rather than a task object, it causes an error:
AttributeError: 'str' object has no attribute 'ignore_result'
Set the 'ignore_result' header to False in _create_request() so the
fallback is never use. This is a no-op for protocol 2 (which already sets
the header) and keeps request.task as the 'my_task' string, preserving
the existing task_name assertions.
Closes: #508
Signed-off-by: Christopher Obbard <obbardc@debian.org>1 parent a895b97 commit 067dfc9
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
0 commit comments