Skip to content
Snippets Groups Projects
Commit e1387ba7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

test for correct redirection when save and continue clicked on subject edit

parent 1c3248c4
No related branches found
No related tags found
1 merge request!100Test coverage unit tests
......@@ -67,6 +67,16 @@ class SubjectsViewTests(LoggedInWithWorkerTestCase):
self.assertTrue(updated_study_subject.subject.dead)
self.assertTrue(updated_study_subject.resigned)
def test_save_subject_edit_with_continue(self):
form_data = self.create_edit_form_data_for_study_subject()
form_data['_continue'] = True
response = self.client.post(reverse('web.views.subject_edit', kwargs={'id': self.study_subject.id}),
data=form_data)
self.assertEqual(response.status_code, 302)
self.assertTrue("edit" in response.url)
def create_edit_form_data_for_study_subject(self):
form_study_subject = StudySubjectEditForm(instance=self.study_subject, prefix="study_subject")
form_subject = SubjectEditForm(instance=self.study_subject.subject, prefix="subject")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment