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.
Release files for fast-test-database 1.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fast_test_database-1.0.9.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fast_test_database-1.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / fast_test_database-1.0.9.tar.gz
| Download URL | fast_test_database-1.0.9.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36d98a0b218ff59a0df856af9f5723d5d6af99f8343fc85e6f3811cc6413a2f8
|
|
BLAKE2b-256 checksum How to use checksums |
7994a39419032320eb52cba4ac692d39cb205324a4c377617d3f27b0dc7b2e58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.15
|
Release files / fast_test_database-1.0.9-py3-none-any.whl
| Download URL | fast_test_database-1.0.9-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1e03d1b5df8dcb04a759ee9b763290714ea179ba34675b35b3720990dd47908
|
|
BLAKE2b-256 checksum How to use checksums |
29fa603a2c458e713022ef01949e05ad2fead4967ff9678d019b2a4d1ee26c55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.15
|