Flask extension provides simple utilities for testing forms
Python Perl CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
flask_fillin
test_app
MANIFEST.in
.gitignore
LICENSE
README.rst README updated for link and html property example Jun 9, 2012
setup.py
tests.py

README.rst

Flask-fillin

This Flask extension provides simple utilities for testing your forms in Flask application.

Installation

The installation is thanks to the Python Package Index and pip really simple.

$ pip install Flask-fillin

If you only can use easy_install than use

$ easy_install Flask-fillin

Flask-fillin requires to run some packages (they will be installed automatically if they not already installed):

  • Flask
  • lxml

Example Usage

from flask.ext.fillin import FormWrapper

client = FlaskClient(flask_app, response_wrapper=FormWrapper)

# form submission
response = client.get('/page_with_form')

response.form.fields['username'] = 'my username'
response.form.fields['password'] = 'secret'
response.form.fields['remember'] = True

response.form.submit(client)

# link navigation
response = client.get('/page_with_links')
response.link("#link-id").click(client)

# underlying parsed html
links = response.html.findall("a")