RentMethod / django-celery-testworker

Test functions to use with Django for tests that depend on the execution of Celery tasks
BSD 3-Clause "New" or "Revised" License
16 stars 9 forks source link

Make into generic celery-worker-testcase #3

Open graingert opened 10 years ago

graingert commented 10 years ago

I'm using celery in a project without the Django settings modules

It would be great if I could use a CeleryTestCase as follows:

from my_service.app import app
from my_service.tasks import my_task

class MyTaskTestCase(CeleryTestCaseMixin, TestCase):
    apps = (app, ) # instead of using Django settings use a specific celery app.
    # Should be monkey patched to use the in memory celery queue
    def test_my_task(self):
        my_task.delay()
willembult commented 9 years ago

Great, check out the celerytest package I created to replace this one: https://github.com/RentMethod/celerytest. It doesn't depend on Django and has monitoring, so your tests don't have to wait arbitrarily.