Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

form.submit should verify it's possible to submit the form #134

Open
sargon2 opened this issue Mar 5, 2015 · 0 comments
Open

form.submit should verify it's possible to submit the form #134

sargon2 opened this issue Mar 5, 2015 · 0 comments

Comments

@sargon2
Copy link

sargon2 commented Mar 5, 2015

I was surprised to learn today that I had made a form which was impossible to submit. I had used webtest to verify that the form was submittable by calling the "form.submit()" method.

If the button referenced in submit() doesn't exist, or if it doesn't actually submit the form, an error should be raised.

For example, this test could be added to tests/test_forms.py:

    def test_incorrect_button_name(self):
        form = self.callFUT(formid='multiple_buttons_form')
        with self.assertRaises(ValueError):
            form.submit("button_that_does_not_exist")

Then another test is needed where the button exists, but doesn't actually submit the form.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant