mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 12:57:40 -02:30
mock additional pg_notify use in test
Signed-off-by: Jessica Mack <jmack@redhat.com>
This commit is contained in:
@@ -294,6 +294,7 @@ def test_logging_aggregator_valid_settings(put, post, admin, type, host, port, u
|
|||||||
mock_settings['LOG_AGGREGATOR_PASSWORD'] = password
|
mock_settings['LOG_AGGREGATOR_PASSWORD'] = password
|
||||||
# mock testing pg_notify
|
# mock testing pg_notify
|
||||||
mocker.patch("awx.conf.views.send_pg_notify", return_value=None)
|
mocker.patch("awx.conf.views.send_pg_notify", return_value=None)
|
||||||
|
mocker.patch("awx.main.tasks.system.send_pg_notify", return_value=None)
|
||||||
url = reverse('api:setting_singleton_detail', kwargs={'category_slug': 'logging'})
|
url = reverse('api:setting_singleton_detail', kwargs={'category_slug': 'logging'})
|
||||||
response = put(url, data=mock_settings, user=admin, expect=200)
|
response = put(url, data=mock_settings, user=admin, expect=200)
|
||||||
assert type in response.data.get('LOG_AGGREGATOR_TYPE')
|
assert type in response.data.get('LOG_AGGREGATOR_TYPE')
|
||||||
@@ -316,6 +317,7 @@ def test_logging_aggregator_connection_test_valid(put, post, admin, mocker):
|
|||||||
mock_settings['LOG_AGGREGATOR_HOST'] = host
|
mock_settings['LOG_AGGREGATOR_HOST'] = host
|
||||||
# mock testing pg_notify
|
# mock testing pg_notify
|
||||||
mocker.patch("awx.conf.views.send_pg_notify", return_value=None)
|
mocker.patch("awx.conf.views.send_pg_notify", return_value=None)
|
||||||
|
mocker.patch("awx.main.tasks.system.send_pg_notify", return_value=None)
|
||||||
# POST to save these mock settings
|
# POST to save these mock settings
|
||||||
url = reverse('api:setting_singleton_detail', kwargs={'category_slug': 'logging'})
|
url = reverse('api:setting_singleton_detail', kwargs={'category_slug': 'logging'})
|
||||||
put(url, data=mock_settings, user=admin, expect=200)
|
put(url, data=mock_settings, user=admin, expect=200)
|
||||||
|
|||||||
Reference in New Issue
Block a user