Skip to content
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

The --keepdb flag is not respected for test databases #104

Open
boc-tdunn opened this issue Oct 8, 2024 · 7 comments
Open

The --keepdb flag is not respected for test databases #104

boc-tdunn opened this issue Oct 8, 2024 · 7 comments

Comments

@boc-tdunn
Copy link

The django docs state that the --keepdb flag should keep the test database from being destroyed after a test run, and that subsequent test runs should not recreate the test database if it exists already.

https://docs.djangoproject.com/en/5.1/topics/testing/overview/#the-test-database

For reference the POSTGRES django adapter does this.

https://github.com/django/django/blob/main/django/db/backends/postgresql/creation.py#L42-L45

@boc-tdunn
Copy link
Author

Somewhat related issue is that Django allows you to provide the name of the test database:
https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-DATABASE-TEST

But python-ibmdb-django always uses this format instead:
https://github.com/ibmdb/python-ibmdb-django/blob/master/ibm_db_django/creation.py#L169

For reference this is what BaseDatabaseCreation does in django:
https://github.com/django/django/blob/main/django/db/backends/base/creation.py#L185-L186

If you'd rather this be a separate issue let me know and I'll do that instead.

@praveen-db2
Copy link
Collaborator

@boc-tdunn usually customers wont keep test database hence we ignored this option. We will handle this in coming releases.

@boc-tdunn
Copy link
Author

I can't promise anything but would this be an issue you would accept a contribution for?

@praveen-db2
Copy link
Collaborator

I didnt understand.

@boc-tdunn
Copy link
Author

Would I be allowed to submit a Pull Request for this issue?

@praveen-db2
Copy link
Collaborator

yes sure, we appreciate everybody's contribution. But we merge it when we plan for next release.

@bimalkjha
Copy link
Member

@boc-tdunn We do not see any PR from you yet. Better to open soon and close this issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants