diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index 8cd1988f2..22fd018e8 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -1,10 +1,12 @@ from django.test import TestCase, RequestFactory, Client +from django_fsm import transition from django.contrib.admin.sites import AdminSite from django.urls import reverse from registrar.admin import ( DomainAdmin, DomainApplicationAdmin, + DomainApplicationAdminForm, ListHeaderAdmin, MyUserAdmin, AuditedAdmin, @@ -36,6 +38,20 @@ import logging logger = logging.getLogger(__name__) +class TestDomainApplicationAdminForm(TestCase): + def setUp(self): + # Create a test application with an initial state of started + self.application = completed_application() + + def test_form_choices(self): + # Create a form instance with the test application + form = DomainApplicationAdminForm(instance=self.application) + + # Verify that the form choices match the available transitions for the initial state + expected_choices = [('started', 'started'), ('submitted', 'submitted')] + self.assertEqual(form.fields['status'].widget.choices, expected_choices) + + class TestDomainApplicationAdmin(TestCase): def setUp(self): self.site = AdminSite()