Fixed #21924 -- added a test and documentation

Added a test and documentation for ticket #21924 (https://code.djangoproject.com/ticket/21924). The original pull request can be seen here: https://github.com/django/django/pull/2201.