Issue
Im trying to test some functions that include a call for celery tasks. the tasks involves a call to 3rd party websites and i need to avoid it during tests.
Any idea how to disable all celery tasks during tests?
Solution
Usually the "good method" imply doing Mocks. http://www.voidspace.org.uk/python/mock/
So you'll return example response from the site.
You can check on class declaration debug state and if True replace the class by the corresponding Mock
Answered By - christophe31
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.