chrismcginlay / eduduck

An abandoned online course hosting platform/marketplace
GNU General Public License v3.0
2 stars 0 forks source link

AssertFormsetError #124

Closed chrismcginlay closed 9 years ago

chrismcginlay commented 10 years ago

http://saravanan.co.uk/topics/testing/tools.html

For example in lesson/test/test_views test_lesson_edit_page_validation_errors_sent_to_template(self): it would be nice to check that error messages are in the response.context.

AssertFormsetError should do it but I can't quite figure the syntax. self.assertFormsetError( response, AttachmentInlineFormset, AttachmentInlineFormset.form.base_fields['name'], 0, LESSON_NAME_FIELD_REQUIRED_ERROR, )

chrismcginlay commented 9 years ago

This has been done, farmed out to separate test function def test_lesson_edit_page_validation_errors_generate_error_msg(self):