3 ms·
When I run my tests with python -Wa I get a lot of warnings that seem to come from inside Django. Is this caused by my code? How can I silence them? /home/co
by Siecje 7y ago
When I run my tests with python -Wa I get a lot of warnings that seem to come from inside Django. Is this caused by my code? How can I silence them?
/home/cody/.virtualenvs/37/lib/python3.7/site-packages/django/db/models/sql/compiler.py:1030: RemovedInDjango30Warning: Remove the context parameter from MultiSelectField.from_db_value(). Support for it will be removed in Django 3.0.
RemovedInDjango30Warning,
/home/cody/.virtualenvs/37/lib/python3.7/site-packages/django/db/models/sql/compiler.py:1030: RemovedInDjango30Warning: Remove the context parameter from MultiSelectField.from_db_value(). Support for it will be removed in Django 3.0.
RemovedInDjango30Warning,
- Denvercoder9 7y agoA quick Google search suggests that this is caused by the django-multiselectfield package, which seems unmaintained (it hasn't been updated for 2 years) and doesn't claim to be compatible with Django 2 or 3.
- Siecje 7y agoThanks I will look at removing this.
- aodin 7y agoRemovedInDjango30Warning inherits from the python built-in DeprecationWarning, so it can ignored on the command line with: python -Wa -Wignore::DeprecationWarning The above, however, will ignore all DeprecationWarning warnings. You can further filter this ignore if you know the module where the warning originates: https://docs.python.org/3/library/warnings.html#describing-warning-filters https://docs.python.org/3/library/warnings.html#describing-w... Alternatively, if you find a package import is causing this warning, you can wrap the import in a context manager that ignores the warning: import warnings from django.utils.deprecation import RemovedInDjango30Warning with warnings.catch_warnings(): warnings.simplefilter("ignore", RemovedInDjango30Warning) import MODULE