5
0
Fork
You've already forked pytest-django-testing-postgresql
0
No description
  • Python 100%
Find a file
2022年01月31日 16:23:57 +01:00
LICENSE Update LICENSE 2020年10月25日 18:01:16 +01:00
MANIFEST.in Add README and udpate packaging metadata. 2019年12月05日 16:18:55 +01:00
pytest_django_testing_postgresql.py Allow database configuration 2022年01月31日 16:22:08 +01:00
README.rst Allow database configuration 2022年01月31日 16:22:08 +01:00
setup.py Fix license classifier 2022年01月31日 16:23:57 +01:00

Temporary PostgreSQL databases for Django and pytest

Use case

This pytest plugin can be used to test a Django application that uses PostgreSQL. It leverages the testing.postgresql module to setup a temporary PostgreSQL database server and injects the configuration for it into Django's settings. It is intended to be used together with pytest-django.

Requirements

testing.postgresql needs the postgresql server binary available.

How to use

To use, simply install the package in your testing environment and laod the django-testing-psotgresql plugin when running pytest (pytest normally auto-discovers it).

The plugin re-uses the configuration used by pytest-django.

By default, only the default database is setup. You can modify this by setting PYTEST_SETUP_DATABASES to a list of database aliases in your settings module. The list can contain strings, or tuples if you want some aliases to share the same database backend.