Fixes a bug where the CLIN type was not displaying correctly for saved

TOs.

The enum for the CLIN type needs to be coerced in the form data so that
the `jedi_clin_field` data is the value of the enum option. Perviously
the `jedi_clin_field` was being populated with a stringified
representation of the enum, like `JEDICLINType.JEDI_CLIN_1`.
This commit is contained in:
dandds
2019-06-18 11:29:38 -04:00
parent 632cd82398
commit c4d8067f45
5 changed files with 25 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
from atst.forms.task_order import CLINForm
from atst.models import JEDICLINType
import tests.factories as factories
def test_clin_form_jedi_clin_type():
jedi_type = JEDICLINType.JEDI_CLIN_2
clin = factories.CLINFactory.create(jedi_clin_type=jedi_type)
clin_form = CLINForm(obj=clin)
assert clin_form.jedi_clin_type.data == jedi_type.value