Fix avatar unit tests on django 1.8+
Review Request #8809 — Created March 10, 2017 and submitted
ConfigForm
s requireUser.get_profile
to exist, but Django has
removed this method in modern versions, causing some test failures.
This patch adds a testcase decorator to re-implement the missing
method when it is not present.
Ran unit tests on Django 1.8 and 1.6: they passed!
-
-
This should probably say that it will attach only if
User.get_profile
doesn't exist, and state that this is the default on Django 1.7+ unless the consuming app manually adds it. -
Let's have this do a comparison to make sure
User.get_profile
is the version this function provides. That'll avoid a potential problem where an import by the test triggers a code path that adds a project-specificUser.get_profile
.
-
Tool: PEP8 Style Checker Processed Files: djblets/avatars/tests.py djblets/testing/decorators.py Tool: Pyflakes Processed Files: djblets/avatars/tests.py djblets/testing/decorators.py