diff --git a/tests/conftest.py b/tests/conftest.py index a5a583040..a5aa1556a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,19 +10,23 @@ TESTS_DIR = py.path.local(__file__) -from django.conf import settings + +@pytest.fixture() +def django_settings(): + from django.conf import settings + return settings from .db_helpers import create_empty_production_database, get_db_engine, DB_NAME @pytest.fixture(scope='function') -def django_testdir(testdir, monkeypatch): +def django_testdir(testdir, monkeypatch, django_settings): if get_db_engine() in ('mysql', 'postgresql_psycopg2'): # Django requires the production database to exists.. create_empty_production_database() - db_settings = copy.deepcopy(settings.DATABASES) + db_settings = copy.deepcopy(django_settings.DATABASES) db_settings['default']['NAME'] = DB_NAME test_settings = ''' diff --git a/tests/settings_postgres.py b/tests/settings_postgres.py index 248523d9c..fa0875126 100644 --- a/tests/settings_postgres.py +++ b/tests/settings_postgres.py @@ -12,7 +12,8 @@ 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'pytest_django', - 'HOST': 'localhost', + 'HOST': None, + #'HOST': 'localhost', 'USER': '', }, }