django-litetest
A lightweight Django manage.py litetest command for quick unittest runs.
If you’ve been developing in Django for a while, you probably have plenty of tests written. This is great, but they probably take a long time to run. If you do any sort of Test-Driven Development, slow tests means a frustrating edit-test loop.
django-litetest helps you run quick, lightweight tests by doing a few things:
Use in-memory SQLite databases instead of your usual test databases,
Use in-memory caches instead of your usual caches,
If you’re using South, creates models directly.
With django-litetest, fixing a bug becomes as quick as this:
Add a new test to reproduce the bug,
Run manage.py litetest testname,
Edit the code to fix the bug,
Run manage.py litetest testname again,
Run manage.py test to ensure that all your tests pass.
Installation
You can get a copy of the source by using:
$ git clone https://github.com/sfllaw/django-litetest.git
This app requires:
Python 2.6 or higher,
Django 1.3 or higher,
SpatiaLite (optional for GIS).
As well, this app is available from PyPi:
$ pip install django-litetest
Configuration
In your Django settings file:
Add 'django_litetest' to INSTALLED_APPS (after 'south' if you are using it),
Add 'LITETEST': True to each of the DATABASES you want sped up,
Add 'LITETEST': True to each of the CACHES you want sped up,
If you are using South, set SOUTH_TESTS_MIGRATE = 'LITETEST' to avoid migrations.
Example settings file
INSTALLED_APPS = (
'south',
'django_litetest',
...
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db',
'USER': 'user',
'PASSWORD': 'password',
'HOST': 'db.example.com',
'PORT': '',
'LITETEST': True,
}
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': 'memcache.example.com:11211',
'LITETEST': True,
},
}
SOUTH_TESTS_MIGRATE = 'LITETEST'
Reporting bugs and submitting patches
Please check our issue tracker for known bugs and feature requests.
We accept pull requests for fixes and new features.
Metadata
Release files for django-litetest 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-litetest-1.0.tar.gz | 8.7 kB | Without provenance | Details for django-litetest-1.0.tar.gz |
Release files / django-litetest-1.0.tar.gz
| Download URL | django-litetest-1.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15fc214cd3c8e6353bae131abf9c149a435abe448cf084955d3173002b781c5d
|
|
BLAKE2b-256 checksum How to use checksums |
8a127373b89cd57d0edaf169556925bac80c13882aee67b2e1cd1d3018090951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-litetest 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.