chipx86 got a fish trophy!
Fix regressions in unit tests due to logging and missing test_scmtools.
Review Request #12421 — Created June 28, 2022 and submitted
We've had a bit of churn recently with regard to the unit test
infrastructure for SCMTools and in-progress changes. Very temporarily,
unit tests could get away with not using thetest_scmtools
fixture,
but only as an artifact of state leakage. Recent landed changes
therefore passed at the time without this fixture, but is needed with it
now, since we still need aTool
object in the database and we only do
this iftest_scmtools
is added.This change adds this missing fixture to all tests that make use of
repositories/SCMTools.It also fixes two other test failures.
One was due to a copy/paste of a bad
logging.disable()
line in a new
test, a copy of the problem fixed in commit 9f51ffeb3. This was causing
test_registry
to fail if run after the bad call.The other was due to a unit test using
assertQueries()
that wasn't
updated for a change inReview
accessibility checks. This has
uncovered a duplicateQ(public=True)
that may be a problem,
particularly when trying to useQ(public=False)
. This needs to be
thoroughly investigated before we ship 5.0, in case there are security
implications.And finally, it disables warnings in test runs due to the empty content
intest_scmtools
by preventing Django from trying to load data from
this fixture insetUpClass()
.
All unit tests pass.
Summary | ID |
---|---|
c77aa391d8ea20bf7a71b3dd698ff404bf40a4eb |
Description | From | Last Updated |
---|---|---|
I we can probably remove this import, I don't think logging is used anywhere else in the file. |
maubin |