Configure an in-memory database for running Django tests
Project description
Use a pure in-memory database for running Django tests.
Usage
In settings.py:
from fast_test_database import fast_test_database
DATABASES = fast_test_database(DATABASES)
# Or:
DATABASES = fast_test_database(DATABASES,
test_commands=('test', 'harvest'))
# Or:
DATABASES = fast_test_database(DATABASES,
version='5.7')
This will be a no-op except for ./manage.py test, when an in-memory database will be automatically started and supplied to the application.
Details
The in-memory database is a full PostgreSQL or MySQL instance started using Docker, using tmpfs for storing the data. A single container will be started if not yet running. It will not be shut down automatically, and instead reused for subsequent tests.
The type of the database (PostgreSQL or MySQL) is chosen based on the existing default database engine.
The default version of the database (PostgreSQL or MySQL) is latest. But it can be specified by version parameter.
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 fast_test_database-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b42508bd4683a1fd5b63df3a5b733cbe75a479ef6ebc2155e45759f628380bcf |
|
MD5 | 5f5f03f1187fbf7ae088377b36ad2515 |
|
BLAKE2b-256 | 4e841a01e1afa88560620b0753f72a201744bb14ec5b833d01e7e8d384285e4d |