diff --git a/pytest_django_testing_postgresql.py b/pytest_django_testing_postgresql.py index 4838f3797c4609d7a1145a754350a07dd4d15b93..38913362ea72ddafbce047bd934d4b27ccb81f3d 100644 --- a/pytest_django_testing_postgresql.py +++ b/pytest_django_testing_postgresql.py @@ -1,4 +1,7 @@ -print('importing') +from dj_database_url import parse +from django.conf import settings +from testing.postgresql import Postgresql -def pytest_configure(config): - print('configuring') +_postgresql = Postgresql() + +django.settings.DATABASES['default'] = parse(_postgresql.url()) diff --git a/setup.py b/setup.py index b32d692f2f03c80f13294b4650e97a42a311f693..64e72e8affb3b09c9ccedac4c5f6a61e136141f8 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( url='https://edugit.org/nik/pytest-django-testing-postgresql', py_modules=['pytest_django_testing_postgresql'], - install_requires=['testing.postgresql'], + install_requires=['dj-database-url', 'testing.postgresql'], entry_points = { 'pytest11': [