Tool: Pyflakes Processed Files: reviewboard/avatars/tests.py reviewboard/avatars/templatetags/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/avatars/tests.py reviewboard/avatars/templatetags/tests.py
'User' imported but unused
'HttpRequest' imported but unused
'Profile' imported but unused
'avatar_services' imported but unused
Clean up and consolidate avatar unit tests
Review Request #8528 — Created Nov. 7, 2016 and submitted
The avatar services tests had a few issues, namely:
- not resetting the registry after test completion;
- templatetag tests being spread out over two files;
- some tests not being updated for the new avatar services API; and
- using improper methods to generate dummy requests.
Some of these issues were causing test failures, while others were more
stylistic issues. All of these issues have been fixed and the avatar
unit tests now all pass.
Ran unit tests.
I think we should have a
reviewboard/avatars/tests/, and have
test_templatetags.pyinside of that, instead of having
The reason is that, as test suites grow, we tend to split things out into a
tests/directory within the app directory, and all unit tests in there. If we were to do that, but template tag tests lived inside the
templatetags/directory, it wouldn't be run as part of the test suite.
It also avoids importing
tests.pyin production, which Django will do when looking for template registries.