Fix handling of packagename_option on DSP:+filebug
If "In what package did you find this bug?" is set to "I don't know" on
DistributionSourcePackage:+filebug, then it's most coherent to treat
that as if the bug had been filed using the corresponding
Distribution:+filebug.
zope.testbrowser 5.0.0 switched its internal implementation to WebTest
instead of mechanize. This necessitates several changes in Launchpad.
In some cases the new default behaviours are already appropriate (for
example, `<meta http-equiv="refresh" />` tags are no longer followed),
and in some we just need to poke into the implementation in slightly
different ways.
We have to patch around a few bugs, although fortunately this can all be
contained in lp.testing.pages:
GitRepositoryCreatorNotOwner exception was surfacing with a 500 http code instead of 400 because of non ASCII character in the name of the user 'devnull' used to invoke remote build.
TestCase has captured OOPSes in Launchpad's unit tests since 2010, but
we've never systematically done the same thing for doctests. This
occasionally causes some problems: with amqp >= 2.4.0 it can mean that
attempts to publish OOPSes to a nonexistent exchange leave unhandled
errors lying around to trip up later tests (see https://code.launchpad.net/~cjwatson/python-oops-amqp/publisher-handle-channel-errors/+merge/367748),
which is extremely confusing and difficult to debug, and I suspect has
caused a number of transient failures on buildbot.
We now systematically capture OOPSes for doctests just as we do for unit
tests, ensuring better test isolation. I cleaned up a few ad-hoc
arrangements in individual doctests.