Integration regression test for case where ClientForm handled RFC 3986
url unparsing incorrectly (it was using "" in place of None for
fragment, due to continuing to support use of stdlib module urlparse
as well as mechanize._rfc3986).  Fixed in ClientForm r33622 .

>>> import mechanize
>>> from mechanize._response import test_response

>>> def forms():
...     forms = []
...     for method in ["GET", "POST"]:
...         data = ('<form action="" method="%s">'
...         '<input type="submit" name="s"/></form>' % method
...         )
...         br = mechanize.Browser()
...         br.set_html(data, "http://example.com/")
...         br.select_form(nr=0)
...         forms.append(br.form)
...     return forms

>>> getform, postform = forms()
>>> getform.click().get_full_url()
'http://example.com/?s='
>>> postform.click().get_full_url()
'http://example.com/'


If something (e.g. calling .forms() triggers parsing, and parsing
fails, the next attempt should not succeed!  This used to happen
because the response held by LinksFactory etc was stale, since it had
already been .read().  Fixed by calling Factory.set_response() on
error.

>>> import mechanize
>>> br = mechanize.Browser()
>>> br.set_html("""\
... <form>
... <input type="text" name="foo" value="a"></input><!!!>
... <input type="text" name="bar" value="b"></input>
... </form>
... """)
>>> try:
...     br.select_form(nr=0)
... except mechanize.ParseError:
...     pass
>>> br.select_form(nr=0)  
