Browse Source

Add USE_TZ=False test run to Travis

Matt Westcott 4 years ago
parent
commit
c3475c8fdf
3 changed files with 7 additions and 1 deletions
  1. 2 0
      .travis.yml
  2. 2 1
      tox.ini
  3. 3 0
      wagtail/tests/settings.py

+ 2 - 0
.travis.yml

@@ -23,6 +23,8 @@ matrix:
      python: 3.8
    - env: TOXENV=py38-dj31-postgres-noelasticsearch-emailuser
      python: 3.8
+   - env: TOXENV=py38-dj31-postgres-noelasticsearch-notz
+     python: 3.8
    - env: TOXENV=py38-dj31stable-postgres-noelasticsearch
      python: 3.8
    - env: TOXENV=py38-djmaster-postgres-noelasticsearch

+ 2 - 1
tox.ini

@@ -2,7 +2,7 @@
 skipsdist = True
 usedevelop = True
 
-envlist = py{36,37,38}-dj{22,30,31,31stable,master}-{sqlite,postgres,mysql,mssql}-{elasticsearch7,elasticsearch6,elasticsearch5,elasticsearch2,noelasticsearch}-{customuser,emailuser},
+envlist = py{36,37,38}-dj{22,30,31,31stable,master}-{sqlite,postgres,mysql,mssql}-{elasticsearch7,elasticsearch6,elasticsearch5,elasticsearch2,noelasticsearch}-{customuser,emailuser}-{tz,notz},
 
 [testenv]
 install_command = pip install -e ".[testing]" -U {opts} {packages}
@@ -48,6 +48,7 @@ setenv =
     sqlite: DATABASE_NAME=wagtail.db
 
     emailuser: USE_EMAIL_USER_MODEL=yes
+    notz: DISABLE_TIMEZONE=yes
 
     # Specific for Appveyor, see:
     # https://www.appveyor.com/docs/services-databases/#sql-server-2016

+ 3 - 0
wagtail/tests/settings.py

@@ -47,6 +47,8 @@ STATICFILES_FINDERS = (
 )
 
 USE_TZ = not os.environ.get('DISABLE_TIMEZONE')
+if not USE_TZ:
+    print("Timezone support disabled")
 
 LANGUAGE_CODE = "en"
 
@@ -166,6 +168,7 @@ WAGTAILSEARCH_BACKENDS = {
 if os.environ.get('USE_EMAIL_USER_MODEL'):
     INSTALLED_APPS.append('wagtail.tests.emailuser')
     AUTH_USER_MODEL = 'emailuser.EmailUser'
+    print("EmailUser (no username) user model active")
 else:
     INSTALLED_APPS.append('wagtail.tests.customuser')
     AUTH_USER_MODEL = 'customuser.CustomUser'