Last active
December 17, 2015 11:59
-
-
Save zhangcheng/5606578 to your computer and use it in GitHub Desktop.
Revisions
-
zhangcheng-aa renamed this gist
May 19, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
zhangcheng-aa created this gist
May 19, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ import wsgi_intercept import wsgi_intercept.mechanize_intercept from wsgi_intercept.test_wsgi_app import create_fn wsgi_intercept.add_wsgi_intercept('some_host', 80, create_fn) b = wsgi_intercept.mechanize_intercept.Browser() response = b.open('http://some_host:80') response.read() import wsgi_intercept import wsgi_intercept.mechanize_intercept from django.core.handlers.wsgi import WSGIHandler wsgi_intercept.add_wsgi_intercept('localhost', 17681, WSGIHandler) b = wsgi_intercept.mechanize_intercept.Browser() b.set_handle_robots(False) b.open('http://localhost:17681/account/login/') b.select_form(nr=1) b.form['username'] = '[email protected]' b.form['password'] = 'admin' response = b.submit() response.read()