fnp
/
fnpdjango.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.5: Django 3.2 support, drop Django<1.11, Python<3.6, remove some compatibility...
[fnpdjango.git]
/
runtests.py
diff --git
a/runtests.py
b/runtests.py
index
3f8dd95
..
c5b392f
100644
(file)
--- a/
runtests.py
+++ b/
runtests.py
@@
-1,13
+1,10
@@
#!/usr/bin/env python
#!/usr/bin/env python
-# -*- coding: utf-8
# This file is part of FNPDjango, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See README.md for more information.
#
"""
Creates a simple Django configuration and runs tests for fnpdjango.
"""
# This file is part of FNPDjango, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See README.md for more information.
#
"""
Creates a simple Django configuration and runs tests for fnpdjango.
"""
-from __future__ import unicode_literals
-
import sys
import os
from os.path import dirname, abspath
import sys
import os
from os.path import dirname, abspath
@@
-28,42
+25,61
@@
if not settings.configured and not os.environ.get('DJANGO_SETTINGS_MODULE'):
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
+
+ 'NAME': 'test.db',
}
},
INSTALLED_APPS=[
}
},
INSTALLED_APPS=[
+ 'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.contenttypes',
+ 'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sessions',
'django.contrib.sites',
+ 'django.contrib.staticfiles',
'fnpdjango',
'tests',
],
LANGUAGE_CODE='pl',
MEDIA_ROOT=media_root,
'fnpdjango',
'tests',
],
LANGUAGE_CODE='pl',
MEDIA_ROOT=media_root,
- MIDDLEWARE_CLASSES=[
+ STATIC_URL='/static/',
+ STATIC_ROOT='./static/',
+ STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineManifestStorage',
+ MIDDLEWARE=[
'django.middleware.common.CommonMiddleware',
'django.middleware.common.CommonMiddleware',
- 'fnpdjango.middleware.URLLocaleMiddleware',
'fnpdjango.middleware.SetRemoteAddrFromXRealIP',
'fnpdjango.middleware.SetRemoteAddrFromXRealIP',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
],
FNPDJANGO_REALIP = True,
ROOT_URLCONF='tests.urls',
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
],
FNPDJANGO_REALIP = True,
ROOT_URLCONF='tests.urls',
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ ]
+ }
},
],
TEST_LAZY_UGETTEXT_LAZY=_("Lazy setting."),
USE_I18N=True,
},
],
TEST_LAZY_UGETTEXT_LAZY=_("Lazy setting."),
USE_I18N=True,
+
+ SECRET_KEY='x',
+ DEBUG=True,
+ SITE_ID=1,
+
+ PIPELINE={}
)
else:
media_root = None
)
else:
media_root = None
-try:
- from django.test.runner import DiscoverRunner
-except ImportError:
- # Django < 1.6
- from django.test.simple import DjangoTestSuiteRunner as DiscoverRunner
+from django.test.runner import DiscoverRunner
def runtests(*test_args, **kwargs):
def runtests(*test_args, **kwargs):
@@
-73,13
+89,8
@@
def runtests(*test_args, **kwargs):
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
- # For Django 1.7+
- try:
- from django import setup
- except ImportError:
- pass
- else:
- setup()
+ from django import setup
+ setup()
test_runner = DiscoverRunner(
verbosity=kwargs.get('verbosity', 1),
test_runner = DiscoverRunner(
verbosity=kwargs.get('verbosity', 1),