mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 05:48:13 +08:00
fixes iron-mq test
purging a queue that never had a message in it raises a not found error. So we queue one message to initialize.
This commit is contained in:
@@ -96,13 +96,14 @@ def test_disque():
|
|||||||
@pytest.mark.skipif(not os.getenv('IRON_MQ_TOKEN'),
|
@pytest.mark.skipif(not os.getenv('IRON_MQ_TOKEN'),
|
||||||
reason="requires IronMQ credentials")
|
reason="requires IronMQ credentials")
|
||||||
def test_ironmq():
|
def test_ironmq():
|
||||||
Conf.IRON_MQ = {'host': os.getenv('IRON_MQ_HOST'),
|
Conf.IRON_MQ = {'token': os.getenv('IRON_MQ_TOKEN'),
|
||||||
'token': os.getenv('IRON_MQ_TOKEN'),
|
|
||||||
'project_id': os.getenv('IRON_MQ_PROJECT_ID')}
|
'project_id': os.getenv('IRON_MQ_PROJECT_ID')}
|
||||||
# check broker
|
# check broker
|
||||||
broker = get_broker(list_key='djangoQ')
|
broker = get_broker(list_key='djangoQ')
|
||||||
assert broker.ping() is True
|
assert broker.ping() is True
|
||||||
assert broker.info() is not None
|
assert broker.info() is not None
|
||||||
|
# initialize the queue
|
||||||
|
broker.enqueue('test')
|
||||||
# clear before we start
|
# clear before we start
|
||||||
broker.purge_queue()
|
broker.purge_queue()
|
||||||
# enqueue
|
# enqueue
|
||||||
|
|||||||
Reference in New Issue
Block a user