Moving notes for assertNumQueries next to the other changes to test infrastructure
Merge pull request #2067 from dominicrodger/master

Moving notes for assertNumQueries next to the other changes to test infrastructure
Added 1.6.2 release notes stub.
Fixed #21580 -- Clarified why render() does not return a TemplateResponse object.
Fixed #21606 -- Fixed default_lat and default_lon override in OSMWidget
Allowed running GIS form tests that don't require spatial database
Fixed link text for "Testing in Django" in tutorial 5.
Removed usage of to-be-deprecated ADMIN_FOR setting in contributing docs
Fixed #21614 -- improved docs on configuring email for development.
Fixed E127 pep8 warnings.
Clarifed table rewrites in migration docs.

Small nitpicks. All column-related ALTER TABLE commands take an
exclusive table lock in PostgreSQL. The difference is that adding a
column without default doesn't cause a table rewrite, so the lock is
held only for a short time.

The time taken is more accurately proportional to table size, not row
count.
Fixed #21250 -- Made HTTP auth user header configurable in tests

Currently, if the authentication mechanism uses a custom HTTP header
and not REMOTE_USER, it is not easy to test. This commit modifies
remote user tests in order to make them more generic.
Moved django.db.models.loading to django.apps.cache.

This commit doesn't contain any code changes; it's purely a refactoring.
Removed BaseAppCache.app_store.

It was only storing redundant information. This is part of the effort to
allow applications without a models module.
Removed ModelDict.

Its only difference with OrderedDict is that it didn't deepcopy its
keys. However it wasn't used anywhere with models modules as keys, only
as values. So this commit doesn't result in any change in functionality.
Removed model-level functions for the app cache.

Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.

They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.

This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
Stored AppConfig objects instead of models modules in the app cache.

This is a step towards allowing applications without a models module.
Removed unused attribute app_errors of the app cache.

get_app_errors() always returned an empty dictionary; this behavior is
preserved in django.db.models.loading until that module is deprecated.
Moved list of models inside AppConfig instances.

This commit is a refactoring with no change of functionality, according
to the following invariants:

- An app_label that was in app_configs and app_models stays in
  app_config and has its 'installed' attribute set to True.

- An app_label that was in app_models but not in app_configs is added to
  app_configs and has its 'installed' attribute set to True.

As a consequence, all the code that iterated on app_configs is modified
to check for the 'installed' attribute. Code that iterated on app_models
is rewritten in terms of app_configs.

Many tests that stored and restored the state of the app cache were
updated.

In the long term, we should reconsider the usefulness of allowing
importing models from non-installed applications. This doesn't sound
particularly useful, can be a trap in some circumstances, and causes
significant complexity in sensitive areas of Django.
Fleshed out AppConfig objects.

Marginally improved creation of AppConfig stubs for non-installed apps.