Fixed#21058 -- Fixed debug view blowing up when no template is provided to the template rendering functions.
Assistance on this commit from @jambonrose.
The Admin widget, which can be used to filter multiple selects
can sometimes be too narrow and hide information such as
user permissions. This commit adds tooltips to the select
options so that a user can hover over and see the hidden text.
Moved the get_serializer() call within the condition that checks public
serializers. This will allow exceptions other than
SerializerDoesNotExist to be raised in order to provide the caller with
useful information, e.g when pyyaml is not installed.
The serializer definitely exists, but the dependent yaml module may not
be installed. The register_serializer() function will catch exceptions
and will stub in a fake serializer object that will raise the exception
when the serializer is used.
Changed th system module values check to return a list.
In Python 3 it returns a dict_view which could occassionally produce
a runtime error of "dictionary changed size during iteration".
- TemporaryFile now minimally mocks the API of the Python standard
library class tempfile.NamedTemporaryFile to avoid AttributeError
exceptions.
- The symbol django.core.files.NamedTemporaryFile is actually assigned
as a different class on different operating systems.
- The bug only occurred if Django is running on Windows, hence why it
was hard to diagnose.
AdminSite now has overridable site_header, site_title and index_title attributes. Changed
each admin view to pass these to the context (in a new AdminSite.each_context() method).
The intent here is to make it easier to override these things in the common case, instead of
having to override a template, which is a bigger burden.
1. Moved common logic between assertContains and assertNotContains
into a separate function _assert_contains()
2. Moved common logic between assertTemplateUsed and
assertTemplateNotUsed into a separate function
_assert_templateused()
Thanks Marc Tamlyn for the report and review.
exc_value might be None even though there's an exception, at least on
Python 2.6. Thanks Thomas Chaumeny for the report.
Fixed#21034.
Forward-port of a8624b2 from 1.6.x.