Mechanize support for Django testcases.
Python
Latest commit d9537cc Feb 19, 2011 Nathan Reynolds Initial commit
Permalink
Failed to load latest commit information.
djangomechanize Initial commit Feb 19, 2011
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()