Update the GerritForm.clean() tests for cross-Django compatibility.
Review Request #10619 — Created July 8, 2019 and submitted — Latest diff uploaded
GerritForm.clean()attempts to set a
gerrit_domainkey based on the
gerrit_urlthat is provided, but otherwise doesn't perform any other
changes to the cleaned data. We had a unit test that checked that the
cleaned data (including domain) contained the values we expected, but
this posed problems on modern versions of Django, as the
gerrit_urldiffered in its return value (the Django 1.6 version
includes a trailing slash while the 1.11 version does not).
Rather than attempting to normalize the version in the test, or key off
expected values by version, we're instead changing the purpose of the
test. It no longer checks the entirety of the cleaned data, but rather
is checking that
gerrit_domainis properly set based off
This avoids checking Django-specific results, sets a precedent in these
tests to have more specific unit tests for any custom keys added going
Unit tests pass on Django 1.6 and 1.11.