I'm trying to test Celery application here's my code
@celery.task(bind=True, default_retry_delay=30)
def convert_video(gif_url, webhook):
// doing something awesome
return
except Exception as exc:
raise convert_video.retry(exc=exc)
And in my test I have this.
server.convert_video.apply(args=('some_gif', 'http://www.company.com?attachment_id=123')).get()
After I added bind=True, default_retry_delay=30
I get this error
TypeError: convert_video() takes exactly 2 arguments (3 given)
To be honest, I've never used celery, but a quick look at their docs for the
bind
argument says that:You generally would only use this if this were a method on a class, not a stand-alone function. As a method on a class, its first argument would be
self
.