I'm attempting to run Django unit tests using:
python -We -W ignore:DeprecationWarning -W ignore:UserWarning manage.py test
However, this doesn't successfully ignore these warning classes, and instead only respects the -We
flag, raising all warnings to exceptions. This is not my desired behavior.
How can I run Django tests such that all warnings except DeprecationWarning and UserWarning are raised as exceptions when encountered in a test?
Use case: the project I am working on sees a lot of RuntimeWarnings being raised because of naive datetimes in the tests. I want to fix this, but to do so, I have to locate the problematic tests.