My situation is similar, and the strategy I'm working with is to mock calls to Celery tasks and then check the calls made to these mocks after starting. Could this work here?
from … import ResizeImageTask
class NonQueuedTestCase(…):
def setUp(self):
"""
Patch out ResizeImageTask delay method
"""
super(NonQueuedTestCase, self).setUp()
self.patcher = patch.object(ResizeImageTask, 'delay', autospec=True)
self.m_delay = self.patcher.start()
def tearDown(self):
self.patcher.stop()
super(NonQueuedTestCase, self).tearDown()
def test_add_user_avatar(self):
add_user_avatar(…)
self.m_delay.assert_called_once_with(…)
( ), , , .