mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Alias unified job template search fields for presentation
The polymorphic accessors have a name that is different than our normal presentation name for these types. This aliases them for the presentation layer and then handles processing them when they are given as filters.
This commit is contained in:
11
awx/main/tests/functional/api/test_unified_job_template.py
Normal file
11
awx/main/tests/functional/api/test_unified_job_template.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import pytest
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_aliased_forward_reverse_field_searches(instance, options, get, admin):
|
||||
url = reverse('api:unified_job_template_list')
|
||||
response = options(url, None, admin)
|
||||
assert 'job_template__search' in response.data['related_search_fields']
|
||||
get(reverse("api:unified_job_template_list") + "?job_template__search=anything", user=admin, expect=200)
|
||||
Reference in New Issue
Block a user