mercredi 18 octobre 2017

How can I uncheck a checkbox with Flask's test client

I'm trying to test my Flask application that has a checkbox input in one of its forms. I can enable the checkbox by doing something like this:

client = myapplication.app.test_client()
client.post('/form', data={'checkboxname': 'on'})

But disabling it doesn't seem to work. I can set it to 'off', None or False, make data an empty dict, only submit another field, doesn't matter, the checkbox stays checked.




Aucun commentaire:

Enregistrer un commentaire