Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Mechanize support for Django testcases.
Python
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
djangomechanize
testproject
README.rst
requirements.txt
setup.py
tests.py

README.rst

Mechanize support for Django testcases.

Testcases are subclasses of DjangoMechanizeTestCase.

The mechanize browser is accessed via self.browser. Your test will fetch URLs from a virtual server running your Django project. This defaults to http://localhost:17681 - use self.browser_url() to avoid hardcoding that address.

e.g:

::
class MyTestCase(DjangoMechanizeTestCase):
def test_with_mechanize(self):
self.browser.open(self.browser_url('/test_view/')) self.browser.select_form(name='upload_form') self.browser.add_file(StringIO('12341234'), 'text/plain', 'test.txt') self.browser.submit()
Something went wrong with that request. Please try again.