@@ -20,8 +20,8 @@ def authorized_client(authorized_client_factory, mock_exporter_user):
20
20
21
21
22
22
@pytest .fixture
23
- def f680_apply_url ():
24
- return reverse ("f680:apply " )
23
+ def apply_for_a_licence_url ():
24
+ return reverse ("apply_for_a_licence:start " )
25
25
26
26
27
27
@pytest .fixture
@@ -129,69 +129,20 @@ def set_f680_allowed_organisation(settings, organisation_pk):
129
129
settings .FEATURE_FLAG_ALLOW_F680 = False
130
130
131
131
132
- class TestApplyForLicenceQuestionsClass :
133
- def test_triage_f680_apply_redirect_success (self , authorized_client , f680_apply_url ):
134
- response = authorized_client .post (reverse ("apply_for_a_licence:f680_questions" ))
135
- assert response .status_code == 302
136
- assert response .url == f680_apply_url
137
-
138
-
139
- class TestF680ApplicationCreateView :
140
- def test_get_create_f680_view_success (
141
- self ,
142
- authorized_client ,
143
- f680_apply_url ,
144
- f680_summary_url_with_application ,
145
- mock_application_post ,
146
- ):
147
- response = authorized_client .get (f680_apply_url )
148
- assert response .status_code == 302
149
- assert response .url == f680_summary_url_with_application
150
- assert mock_application_post .called_once
151
- assert mock_application_post .last_request .json () == {"application" : {}}
152
-
153
- def test_get_create_f680_view_success_allowed_organisation (
132
+ class TestF680ApplyForALicence :
133
+ def test_POST_apply_for_a_licence_success (
154
134
self ,
155
135
authorized_client ,
156
- f680_apply_url ,
136
+ apply_for_a_licence_url ,
157
137
f680_summary_url_with_application ,
158
138
mock_application_post ,
159
- set_f680_allowed_organisation ,
160
139
):
161
- response = authorized_client .get ( f680_apply_url )
140
+ response = authorized_client .post ( apply_for_a_licence_url , data = { "licence_type" : "f680" } )
162
141
assert response .status_code == 302
163
142
assert response .url == f680_summary_url_with_application
164
143
assert mock_application_post .called_once
165
144
assert mock_application_post .last_request .json () == {"application" : {}}
166
145
167
- def test_get_create_f680_view_fail_with_feature_flag_off (
168
- self ,
169
- authorized_client ,
170
- f680_apply_url ,
171
- mock_f680_application_get ,
172
- unset_f680_feature_flag ,
173
- ):
174
- response = authorized_client .get (f680_apply_url )
175
- assert response .context [0 ].get ("title" ) == "Forbidden"
176
- assert (
177
- "You are not authorised to use the F680 Security Clearance application feature"
178
- in response .context [0 ].get ("description" ).args
179
- )
180
-
181
- def test_get_create_f680_view_fail_with_feature_organidation_not_allowed (
182
- self ,
183
- authorized_client ,
184
- f680_apply_url ,
185
- mock_f680_application_get ,
186
- unset_f680_allowed_organisation ,
187
- ):
188
- response = authorized_client .get (f680_apply_url )
189
- assert response .context [0 ].get ("title" ) == "Forbidden"
190
- assert (
191
- "You are not authorised to use the F680 Security Clearance application feature"
192
- in response .context [0 ].get ("description" ).args
193
- )
194
-
195
146
196
147
class TestF680ApplicationSummaryView :
197
148
def test_get_f680_summary_view_success (
0 commit comments