def test_validation_warnings(self, send_confirmation):
applicant = factories.ApplicantFactory.create()
self.set_form_session_data(
counties=['sanfrancisco'], applicant_id=applicant.id)
with self.assertLogs(
'project.services.logging_service', logging.INFO) as logs:
response = self.client.fill_form(
reverse(self.view_name),
**mock.fake.sf_pubdef_answers(ssn=''))
self.assertRedirects(
response, reverse('intake-confirm'), fetch_redirect_response=False)
response = self.client.get(response.url)
self.assertContains(response, escape(WARNING_FLASH_MESSAGE))
self.assertContains(
response,
escape(
fields.SocialSecurityNumberField.is_recommended_error_message))
send_confirmation.assert_not_called()
assertInLogsCount(
logs, {
'event_name=application_page_complete': 1,
'event_name=application_started': 0,
'event_name=application_submitted': 0,
'event_name=application_errors': 0,
})
test_county_application_view.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录