mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 00:37:37 -02:30
Add api test, edit AWX docs
This commit is contained in:
24
awx/main/tests/functional/api/test_notifications.py
Normal file
24
awx/main/tests/functional/api/test_notifications.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import pytest
|
||||
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_get_jt_running_notification(get, admin, job_template):
|
||||
url = reverse('api:job_template_notification_templates_started_list', kwargs={'pk': job_template.pk})
|
||||
response = get(url, admin)
|
||||
assert response.status_code == 200
|
||||
assert len(response.data['results']) == 0
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_post_jt_running_notification(get, post, admin, notification_template, job_template):
|
||||
url = reverse('api:job_template_notification_templates_started_list', kwargs={'pk': job_template.pk})
|
||||
response = post(url,
|
||||
dict(id=notification_template.id,
|
||||
associate=True),
|
||||
admin)
|
||||
assert response.status_code == 204
|
||||
response = get(url, admin)
|
||||
assert response.status_code == 200
|
||||
assert len(response.data['results']) == 1
|
||||
Reference in New Issue
Block a user