old_contents: import os
  
  INSTALLED_APPS = [
      'wagtailmodelchooser',
      'tests.app',
  
      'taggit',
      'modelcluster',
  
      'wagtail.core',
      'wagtail.admin',
      'wagtail.users',
      'wagtail.sites',
      'wagtail.snippets',
      'wagtail.search',
      'wagtail.documents',
      'wagtail.images',
      'wagtail.contrib.routable_page',
      'wagtail.contrib.modeladmin',
  
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.messages',
      'django.contrib.sessions',
      'django.contrib.staticfiles',
  ]
  
  SECRET_KEY = 'not a secret'
  
  ROOT_URLCONF = 'tests.app.urls'
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': 'test.sqlite3',
      },
  }
  
  WAGTAIL_SITE_NAME = 'Wagtail News'
  
  DEBUG = True
  
  USE_TZ = True
  TIME_ZONE = 'Australia/Hobart'
  
  MIDDLEWARE = [
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  
      'wagtail.core.middleware.SiteMiddleware',
  ]
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.contrib.auth.context_processors.auth',
                  'django.template.context_processors.debug',
                  'django.template.context_processors.i18n',
                  'django.template.context_processors.media',
                  'django.template.context_processors.static',
                  'django.template.context_processors.tz',
                  'django.template.context_processors.request',
                  'django.contrib.messages.context_processors.messages'
              ],
          },
      },
  ]
  
  STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static')
  STATIC_URL = '/static/'
  
new_contents: import os
  from wagtail import VERSION as WAGTAIL_VERSION
  
  INSTALLED_APPS = [
      'wagtailmodelchooser',
      'tests.app',
  
      'taggit',
      'modelcluster',
  
      'wagtail.core',
      'wagtail.admin',
      'wagtail.users',
      'wagtail.sites',
      'wagtail.snippets',
      'wagtail.search',
      'wagtail.documents',
      'wagtail.images',
      'wagtail.contrib.routable_page',
      'wagtail.contrib.modeladmin',
  
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.messages',
      'django.contrib.sessions',
      'django.contrib.staticfiles',
  ]
  
  SECRET_KEY = 'not a secret'
  
  ROOT_URLCONF = 'tests.app.urls'
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': 'test.sqlite3',
      },
  }
  
  WAGTAIL_SITE_NAME = 'Wagtail News'
  
  DEBUG = True
  
  USE_TZ = True
  TIME_ZONE = 'Australia/Hobart'
  
  MIDDLEWARE = [
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  if WAGTAIL_VERSION < (2, 9):
      MIDDLEWARE.append('wagtail.core.middleware.SiteMiddleware')
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.contrib.auth.context_processors.auth',
                  'django.template.context_processors.debug',
                  'django.template.context_processors.i18n',
                  'django.template.context_processors.media',
                  'django.template.context_processors.static',
                  'django.template.context_processors.tz',
                  'django.template.context_processors.request',
                  'django.contrib.messages.context_processors.messages'
              ],
          },
      },
  ]
  
  STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static')
  STATIC_URL = '/static/'
  
subject: Fix middleware in test settings for Wagtail>=2.11