djangogirls
djangogirls copied to clipboard
Add test coverage for `done` method of `OrganizeFormWizard` in `organize/views.py`
We are always experiencing server errors in the event application process which require manual troubleshooting because the done
method lacks test coverage. The code for submitting the form, which is in the done method of OrganizeFormWizard in organize/views.py, lacks coverage.
Tests need to be written for this method.
I'm not entirely sure how you test done()
of a WizardView
class, because that method doesn't have a URL to test.
Hey @marksweb, so the method is called by this url in organize/urls.py
after all the form steps have been successful. It's using django-formtools. I was able to test most of the form steps using post requests but wasn't sure about hitting the database bit which is handled in the done()
method. Maybe @carltongibson can help us with ideas for this test.
I saw via sentry that done
appears to be exposed in the urls as a step in the wizard.
It expects a list of validated forms, so there may be a way of calling that, but I don't think it'll take the usual get/post requests from the client.