diff --git a/dj_cqrs/transport/rabbit_mq.py b/dj_cqrs/transport/rabbit_mq.py index 478763e..fbe3349 100644 --- a/dj_cqrs/transport/rabbit_mq.py +++ b/dj_cqrs/transport/rabbit_mq.py @@ -113,6 +113,7 @@ def _produce_with_retries(cls, payload, retries): exceptions.ChannelError, exceptions.ReentrancyError, AMQPConnectorException, + AssertionError, ) as e: # in case of any error - close connection and try to reconnect cls.clean_connection() diff --git a/integration_tests/rdbms.yml b/integration_tests/rdbms.yml index 952251f..6befe38 100644 --- a/integration_tests/rdbms.yml +++ b/integration_tests/rdbms.yml @@ -33,5 +33,5 @@ services: bash -c ' dockerize -wait tcp://postgres:5432 -timeout 50s && dockerize -wait tcp://mysql:3306 -timeout 50s && - pytest + pytest -v ' diff --git a/requirements/dev.txt b/requirements/dev.txt index 13285e0..24a36c0 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -Django>=3.2 +Django>=3.2,<4.2 pika>=1.0.0 kombu>=4.6 ujson>=5.4.0 diff --git a/tests/test_transport/test_rabbit_mq.py b/tests/test_transport/test_rabbit_mq.py index e7c3ca1..fcff07d 100644 --- a/tests/test_transport/test_rabbit_mq.py +++ b/tests/test_transport/test_rabbit_mq.py @@ -173,7 +173,7 @@ def rabbit_transport(settings): @pytest.mark.parametrize( - 'exception', (AMQPError, ChannelError, ReentrancyError, AMQPConnectorException), + 'exception', (AMQPError, ChannelError, ReentrancyError, AMQPConnectorException, AssertionError), ) def test_produce_connection_error(exception, rabbit_transport, mocker, caplog): mocker.patch.object(RabbitMQTransport, '_get_producer_rmq_objects', side_effect=exception)