diff --git a/manage.py b/manage.py deleted file mode 100644 index e69de29..0000000 diff --git a/setup.cfg b/setup.cfg index 837b2fe..5e40900 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,2 @@ [wheel] universal = 1 - -[tool:pytest] -DJANGO_SETTINGS_MODULE = tests.testproject.settings diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..49cfd8e --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,7 @@ +from django.conf import settings + +from testproject import settings as testproject_settings + + +def pytest_configure(): + settings.configure(**vars(testproject_settings)) diff --git a/tests/test_command.py b/tests/test_command.py index 93415eb..d685160 100644 --- a/tests/test_command.py +++ b/tests/test_command.py @@ -4,7 +4,7 @@ import pkg_resources from django.core.management import call_command TEST_LOCALE_DIR = pkg_resources.resource_filename( - 'tests.testproject', 'locale' + 'testproject', 'locale' ) diff --git a/tests/testproject/settings.py b/tests/testproject/settings.py index 42947f8..e3b46c8 100644 --- a/tests/testproject/settings.py +++ b/tests/testproject/settings.py @@ -2,10 +2,10 @@ import pkg_resources SECRET_KEY = 'x' USE_I18N = True -ROOT_URLCONF = 'tests.testproject.urls' +ROOT_URLCONF = 'testproject.urls' INSTALLED_APPS = [ 'django_babel', - 'tests.testproject', + 'testproject', ] MIDDLEWARE_CLASSES = [ 'django.middleware.locale.LocaleMiddleware',