#24919 closed New feature (fixed)
Add an option not to run migrations when running tests
Reported by: | Kai Richard König | Owned by: | Andrew Godwin |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | 1.9 |
Cc: | Andrew Godwin, cmawebsite@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
With large apps it takes too long to run all migrations if you just want to run a single test or testcase. Furthermore keepdb is not an option if you already use an in memory sqlite db.
Change History (19)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Summary: | Don't run migrations when running tests → Add an option not to run migrations when running tests |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → New feature |
Version: | 1.8 → master |
comment:3 by , 10 years ago
comment:4 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:8 by , 9 years ago
Cc: | added |
---|
comment:9 by , 9 years ago
@andrewgodwin what's your thought about https://github.com/django/django/pull/5255
comment:10 by , 9 years ago
Has patch: | set |
---|---|
Keywords: | 1.9 added |
follow-up: 15 comment:11 by , 9 years ago
Patch needs improvement: | set |
---|
Added some ideas for improvement to the PR.
As I mentioned in IRC, it could also be useful to allow the DATABASES['TEST']['MIGRATE'] = False
option that Andrew's first PR suggested to be a shortcut for setting MIGRATION_MODULES = {'a': None, 'b': None', ...}
for all apps. This could be done later or in a separate commit though. The main concern I have with this idea is whether or not it makes sense in a multi-db situation.
comment:12 by , 9 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:15 by , 9 years ago
Replying to timgraham:
Added some ideas for improvement to the PR.
As I mentioned in IRC, it could also be useful to allow the
DATABASES['TEST']['MIGRATE'] = False
option that Andrew's first PR suggested to be a shortcut for settingMIGRATION_MODULES = {'a': None, 'b': None', ...}
for all apps. This could be done later or in a separate commit though. The main concern I have with this idea is whether or not it makes sense in a multi-db situation.
I created #25388 to keep track of this proposal if somebody wants to work on it.
See discussion and PR