-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #645 from deschler/pytest
feat(dev): Migrate to pytest
- Loading branch information
Showing
14 changed files
with
2,378 additions
and
1,486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,62 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Settings overrided for test time | ||
""" | ||
from django.conf import settings | ||
import os | ||
import warnings | ||
|
||
warnings.simplefilter('always', DeprecationWarning) | ||
|
||
INSTALLED_APPS = tuple(settings.INSTALLED_APPS) + ('modeltranslation.tests',) | ||
|
||
def _get_database_config(): | ||
db = os.getenv('DB', 'sqlite') | ||
host = os.getenv('DB_HOST', 'localhost') | ||
conf = { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': ':memory:', | ||
'TEST': { | ||
'SERIALIZE': False, | ||
}, | ||
} | ||
if db == 'mysql': | ||
conf.update( | ||
{ | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': os.getenv('MYSQL_DATABASE', 'modeltranslation'), | ||
'USER': os.getenv('MYSQL_USER', 'root'), | ||
'PASSWORD': os.getenv('MYSQL_PASSWORD', 'password'), | ||
'HOST': host, | ||
} | ||
) | ||
elif db == 'postgres': | ||
conf.update( | ||
{ | ||
'ENGINE': 'django.db.backends.postgresql', | ||
'USER': os.getenv('POSTGRES_USER', 'postgres'), | ||
'PASSWORD': os.getenv('POSTGRES_DB', 'postgres'), | ||
'NAME': os.getenv('POSTGRES_DB', 'modeltranslation'), | ||
'HOST': host, | ||
} | ||
) | ||
return conf | ||
|
||
|
||
DATABASES = {"default": _get_database_config()} | ||
|
||
INSTALLED_APPS = ( | ||
'django.contrib.contenttypes', | ||
'django.contrib.auth', | ||
'modeltranslation', | ||
'modeltranslation.tests', | ||
) | ||
|
||
LANGUAGES = (('de', 'Deutsch'), ('en', 'English')) | ||
LANGUAGE_CODE = 'de' | ||
MODELTRANSLATION_DEFAULT_LANGUAGE = 'de' | ||
|
||
USE_I18N = True | ||
USE_TZ = False | ||
MIDDLEWARE_CLASSES = () | ||
|
||
MODELTRANSLATION_DEFAULT_LANGUAGE = 'de' | ||
MODELTRANSLATION_AUTO_POPULATE = False | ||
MODELTRANSLATION_FALLBACK_LANGUAGES = () | ||
|
||
ROOT_URLCONF = 'modeltranslation.tests.urls' | ||
|
||
MIGRATION_MODULES = {'auth': 'modeltranslation.tests.auth_migrations'} | ||
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.