mirror of
https://github.com/ansible/awx.git
synced 2026-09-04 19:08:30 -02:30
Removing references to 'any' state notifications
This commit is contained in:
@@ -42,9 +42,10 @@ def test_inventory_source_notification_on_cloud_only(get, post, inventory_source
|
||||
|
||||
not_is = inventory_source_factory("not_ec2")
|
||||
|
||||
url = reverse('api:inventory_source_notification_templates_any_list', kwargs={'pk': cloud_is.id})
|
||||
response = post(url, dict(id=notification_template.id), u)
|
||||
assert response.status_code == 204
|
||||
# Delete the below portion?
|
||||
# url = reverse('api:inventory_source_notification_templates_any_list', kwargs={'pk': cloud_is.id})
|
||||
# response = post(url, dict(id=notification_template.id), u)
|
||||
# assert response.status_code == 204
|
||||
|
||||
url = reverse('api:inventory_source_notification_templates_success_list', kwargs={'pk': not_is.id})
|
||||
response = post(url, dict(id=notification_template.id), u)
|
||||
|
||||
@@ -92,18 +92,19 @@ def test_inherited_notification_templates(get, post, user, organization, project
|
||||
isrc.save()
|
||||
jt = JobTemplate.objects.create(name='test', inventory=i, project=project, playbook='debug.yml')
|
||||
jt.save()
|
||||
url = reverse('api:organization_notification_templates_any_list', kwargs={'pk': organization.id})
|
||||
response = post(url, dict(id=notification_templates[0]), u)
|
||||
assert response.status_code == 204
|
||||
url = reverse('api:project_notification_templates_any_list', kwargs={'pk': project.id})
|
||||
response = post(url, dict(id=notification_templates[1]), u)
|
||||
assert response.status_code == 204
|
||||
url = reverse('api:job_template_notification_templates_any_list', kwargs={'pk': jt.id})
|
||||
response = post(url, dict(id=notification_templates[2]), u)
|
||||
assert response.status_code == 204
|
||||
assert len(jt.notification_templates['any']) == 3
|
||||
assert len(project.notification_templates['any']) == 2
|
||||
assert len(isrc.notification_templates['any']) == 1
|
||||
# What can we replace the below tests with?
|
||||
# url = reverse('api:organization_notification_templates_any_list', kwargs={'pk': organization.id})
|
||||
# response = post(url, dict(id=notification_templates[0]), u)
|
||||
# assert response.status_code == 204
|
||||
# url = reverse('api:project_notification_templates_any_list', kwargs={'pk': project.id})
|
||||
# response = post(url, dict(id=notification_templates[1]), u)
|
||||
# assert response.status_code == 204
|
||||
# url = reverse('api:job_template_notification_templates_any_list', kwargs={'pk': jt.id})
|
||||
# response = post(url, dict(id=notification_templates[2]), u)
|
||||
# assert response.status_code == 204
|
||||
# assert len(jt.notification_templates['any']) == 3
|
||||
# assert len(project.notification_templates['any']) == 2
|
||||
# assert len(isrc.notification_templates['any']) == 1
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestInventorySourceSerializerGetRelated(object):
|
||||
'activity_stream',
|
||||
'notification_templates_error',
|
||||
'notification_templates_success',
|
||||
'notification_templates_any',
|
||||
'notification_templates_started',
|
||||
'inventory_updates',
|
||||
'update',
|
||||
'hosts',
|
||||
|
||||
@@ -50,7 +50,7 @@ class TestJobTemplateSerializerGetRelated():
|
||||
'schedules',
|
||||
'activity_stream',
|
||||
'launch',
|
||||
'notification_templates_any',
|
||||
'notification_templates_started',
|
||||
'notification_templates_success',
|
||||
'notification_templates_error',
|
||||
'survey_spec',
|
||||
|
||||
Reference in New Issue
Block a user