Fix Django 1.11 compatibility for auth validation methods.
Review Request #10837 — Created Jan. 19, 2020 and submitted — Latest diff uploaded
djblets.auth.util.validate_test_cookie()was using an old module
ErrorList(), used for form errors. We had a couple
imports at the top of the module that were designed to locate the
correct version of this for
validate_test_cookiewasn't using it.
A more correct approach, which this change implements, is to use the
error_classattribute instead, which defaults to
ErrorListbut could be something more specific on some forms. This
simplifies our code, since we don't have to guess where the class is,
and ensures we work with more form implementations.
Unit tests were added for the validation methods to ensure they work in
all Django versions.
Unit tests pass on Django 1.7 and 1.11.