'Celery_worker fixture in pytest, connection already closed error

I have such pytest structure

import pytest

@pytest.mark.django_db
class TestClass:
    def test_celery_mht_notification_create(self, celery_worker, user):
        # some test logic

When I use celery_worker fixture, I get such error psycopg2.InterfaceError: connection already closed

How to fix that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source