Django Test Without Migrations: Disable migrations when running your Django tests
Test Without Migrations is a manage.py test command extension.
The new Django 1.7 and 1.8 migration backend demands that you create a migration every time you change a model.
This can be inconvenient when you’re just trying to explore your models code.
In older Django versions, with South we could use the SOUTH_TEST_MIGRATIONS settings to tell Django to simply create all model tables without running migrations.
This app adds this capability to Django by extending the manage.py test command with a –nomigrations option.
Installation
Test Without Migrations works with Django 1.7+.
To install it, simply:
$ pip install django-test-without-migrations
Then add it to your INSTALLED_APPS on your settings.py:
INSTALLED_APPS = (
# ...
'test_without_migrations',
)
You will want to make sure that test_without_migrations appears before any other apps in INSTALLED_APPS that provide a custom test management command.
In this case, you will also want to set the TEST_WITHOUT_MIGRATIONS_COMMAND setting:
TEST_WITHOUT_MIGRATIONS_COMMAND = 'django_nose.management.commands.test.Command'
This will ensure that you don’t lose any additional functionality provided by your custom test management command.
Usage
Inform the flag --nomigrations when running your tests:
$ python manage.py test --nomigrations
Or use the alias -n:
$ python manage.py test -n
Version 0.6 also supports testserver command:
$ python manage.py testserver --nomigrations myfixture.json
Inspiration
This library was directly inspired by this solution: https://gist.github.com/NotSqrt/5f3c76cd15e40ef62d09
License
The MIT License.
Metadata
Release files for django-test-without-migrations 0.6
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-test-without-migrations-0.6.tar.gz | 3.5 kB | Without provenance | Details for django-test-without-migrations-0.6.tar.gz |
Release files / django-test-without-migrations-0.6.tar.gz
| Download URL | django-test-without-migrations-0.6.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28fbe94d23f314f524acea7ff23ef6f72ddb232492d6d0b39c25a97fc20be0fa
|
|
BLAKE2b-256 checksum How to use checksums |
c7b77c9f3dee1288dc5e5ff6f18c6425a51ad6c5e38a51d423a25972e97311b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-test-without-migrations 0.6
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.