Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Mechanize support for Django testcases.
Python
branch: master

Initial commit

latest commit d9537ccf8c
Nathan Reynolds authored
Failed to load latest commit information.
djangomechanize Initial commit
testproject Initial commit
README.rst Initial commit
requirements.txt Initial commit
setup.py Initial commit
tests.py Initial commit

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.