Use a temporary PostgreSQL database with pytest-django
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest-django-testing-postgresql-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c256e262f144fbb0c717d592a649dbfe2852f4648c53c1a011cf48ccd8e0762 |
|
MD5 | c6cec684b89eebd7697d835e137314b4 |
|
BLAKE2b-256 | 81eabf20af6bd0a88846b7875b3e4feea8d446b1d6010615aa72f853aa425e15 |
Hashes for pytest_django_testing_postgresql-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5807ae4d121920f6f10c42ccea5dec9f4a204c0ae1ea82adad29f59ac8a7c4 |
|
MD5 | 29912271bc1fd65f91776cf2ff609851 |
|
BLAKE2b-256 | 11bd40afceaea1ad0b440bc9426b1dcaac891c0710ec496dca777a3c2498cf2c |