test: fix test broken by 40fd46a2 (#4847)

This commit is contained in:
Jennifer Richards 2022-12-07 17:06:43 -04:00 committed by GitHub
parent 40fd46a293
commit 015ac316fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -590,26 +590,26 @@ class InterimTests(TestCase):
mock_form.changed_data = []
mock_form.requires_approval = True
mock_form.cleaned_data = {'remote_participation': None}
mock_form.cleaned_data = {'date': date_today(), 'time': datetime.time(1, 23), 'remote_participation': None}
sessions_post_save(RequestFactory().post('/some/url'), [mock_form])
self.assertTrue(mock_create_method.called)
self.assertCountEqual(mock_create_method.call_args[0][0], [])
mock_create_method.reset_mock()
mock_form.cleaned_data = {'remote_participation': 'manual'}
mock_form.cleaned_data['remote_participation'] = 'manual'
sessions_post_save(RequestFactory().post('/some/url'), [mock_form])
self.assertTrue(mock_create_method.called)
self.assertCountEqual(mock_create_method.call_args[0][0], [])
mock_create_method.reset_mock()
mock_form.cleaned_data = {'remote_participation': 'meetecho'}
mock_form.cleaned_data['remote_participation'] = 'meetecho'
sessions_post_save(RequestFactory().post('/some/url'), [mock_form])
self.assertTrue(mock_create_method.called)
self.assertCountEqual(mock_create_method.call_args[0][0], [session])
# Check that an exception does not percolate through sessions_post_save
mock_create_method.side_effect = RuntimeError('some error')
mock_form.cleaned_data = {'remote_participation': 'meetecho'}
mock_form.cleaned_data['remote_participation'] = 'meetecho'
# create mock request with session / message storage
request = RequestFactory().post('/some/url')
setattr(request, 'session', 'session')