Set celery CELERY_DB_REUSE_MAX high enough that celery will not suddenly close the database connection during tests (causing things to fail in odd ways). This requires djcelery >= 2.5 to work (2.4.2 and below fetch the configuration setting incorrectly so there is no way to set REUSE_MAX).