-
Notifications
You must be signed in to change notification settings - Fork 10
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
harvest uses the production database when --keepdb is used #47
Comments
Another point, the code that is hitting this in a before.all hook. This code appears to be executing against the production database:
|
And the bug only appears when executing a specific feature file. Here is the derived command from my makefile:
|
I did not verify this but won't be surprised if this is inherited from django-nose. I am currently investigating if it would be feasible to switch away the whole project from Nose to either Py.test, Nose 2 or plain unittest. |
Py.test seems to have a significant following, but I don't have much experience with nose or Py.test, so it is hard for me to compare. I was reading over py.test and trolling the issues and came across this: Our bug might be triggered by django-cms opening the database very early. The proposed patches in both testing tools haven't been picked up probably because this is such a corner case. |
This looks similar to aloetesting/aloe#118. Are you running a single feature or letting Aloe/Nose discover them? |
@electroniceagle can you please try |
If you use --keepdb, aloe will use your production database 'foo' rather than 'test_foo' in some circumstances. I think I've hit this bug in django-nose using --keepdb:
jazzband/django-nose#76
I only noticed this because postgresql hit a constraint error on a table that does not currently exist in Django (we removed the app, but forgot to clean the tables).
Despite the connection claiming it is connected to the 'test_site_awesim' database, the constraint error is for a table that only exists in my local copy of our production database.
Here is our current config.
Our workaround is to manually prepend 'test' to the NAME in the DATABASES setting.
The text was updated successfully, but these errors were encountered: