bring back meta choice options lost in upgrade

* status and launch_type OPTIONS choices were lost in the django + drf
upgrade. This brings them back.
This commit is contained in:
Chris Meyers
2016-02-19 14:46:19 -05:00
parent 30633cc82e
commit d70615efbd
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import pytest
from awx.main.models import UnifiedJob
from django.core.urlresolvers import reverse
@pytest.mark.django_db
def test_options_fields_choices(instance, options, user):
url = reverse('api:unified_job_list')
response = options(url, None, user('admin', True))
assert 'launch_type' in response.data['actions']['GET']
assert 'choice' == response.data['actions']['GET']['launch_type']['type']
assert UnifiedJob.LAUNCH_TYPE_CHOICES == response.data['actions']['GET']['launch_type']['choices']
assert 'choice' == response.data['actions']['GET']['status']['type']
assert UnifiedJob.STATUS_CHOICES == response.data['actions']['GET']['status']['choices']