Ejemplo n.º 1
0
def test_backend_cleanup(app):
    with app.app_context():
        task = app.celery.tasks['celery.backend_cleanup']
        task.apply = mock.Mock(spec=task.apply)

        celery.backend_cleanup(None)

        task.apply.assert_called_with()
def test_backend_cleanup(app):
    with app.app_context():
        task = app.celery.tasks['celery.backend_cleanup']
        task.apply = mock.Mock(spec=task.apply)

        celery.backend_cleanup(None)

        task.apply.assert_called_with()
Ejemplo n.º 3
0
def test_backend_cleanup_skip(app):
    """With CELERY_TASK_RESULT_EXPIRES false, the backend cleanup
    task does nothing"""
    with app.app_context():
        task = app.celery.tasks['celery.backend_cleanup']
        task.apply = mock.Mock(spec=task.apply)

        celery.backend_cleanup(None)

        eq_(task.apply.mock_calls, [])
def test_backend_cleanup_skip(app):
    """With CELERY_TASK_RESULT_EXPIRES false, the backend cleanup
    task does nothing"""
    with app.app_context():
        task = app.celery.tasks['celery.backend_cleanup']
        task.apply = mock.Mock(spec=task.apply)

        celery.backend_cleanup(None)

        eq_(task.apply.mock_calls, [])