-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Django's --keepdb
with Django 1.8+
#261
Conversation
Please note that this will change the errors you will see when the test database cannot be created on PostgreSQL, because Django will ignore the error from Reported for Django at https://code.djangoproject.com/ticket/25406. |
Django 1.8 supports `--keepdb` [1], and it makes sense to make use of it. This should probably handle migrations in the context of `transactional_db` better, i.e. by re-applying migrations with a flushed DB. 1: https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---keepdb
93fca47
to
a5452b6
Compare
This is great! Is this fully backward compatible with our old monkey patching? (I guess it is since all tests passes) I think we should deprecate |
👍 Will you do it? |
I'd like to get a new release out and will focus on that for now, but I can give it a shot after that if you or no-one else gets there before me :) |
(I have no problem merging this before btw, we can do the deprecation in a separate PR) |
The errors are different, because it triggers a bug in Django (#261 (comment)). Maybe it is better to not mess with it for the next release then? |
This would be a really cool thing to have - I would like to drop pytest in a project I'm on now, but its dependent on the I guess this is conditional on a solution to https://code.djangoproject.com/ticket/25406.. Can I help in any way? |
Use Django's `--keepdb` with Django 1.8+
I have merged this now but not deprecated @agamdua You can already get the same functionality with |
Django 1.8 supports
--keepdb
[1], and it makes sense to make use ofit. This should probably handle migrations in the context of
transactional_db
better, i.e. by re-applying migrations with a flushedDB.
1: https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---keepdb