-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Fix for https://github.com/django-nose/django-nose/issues/197 #207
Fix for https://github.com/django-nose/django-nose/issues/197 #207
Conversation
@@ -381,7 +381,8 @@ def _foreign_key_ignoring_handle(self, *fixture_labels, **options): | |||
connection.close() | |||
|
|||
|
|||
def _skip_create_test_db(self, verbosity=1, autoclobber=False, serialize=True): | |||
def _skip_create_test_db(self, verbosity=1, autoclobber=False, serialize=True, | |||
keepdb=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you adding the new variable keepdb
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This keyword arg is passed now by Django 1.8, so it needs to be added here to prevent the following error:
File "/[directory_path]/lib/python2.7/site-packages/django/test/runner.py", line 370, in setup_databases
serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
TypeError: _skip_create_test_db() got an unexpected keyword argument 'keepdb'
This is the same reason the serialize argument was added for 1.7 in this fix: 4c9cf02
In the |
People keep asking for REUSE_DB to work again, which is what this pull request addresses. What is not addressed here is the legacy transaction management in FastFixtureTestCase. Perhaps someone can do a different fix for that. Until then, there's no reason to not fix REUSE_DB. |
Awesome, thanks Scott! |
@scottsexton - can you rebase this change on the new master ( I've made significant changes to the project, which includes:
https://travis-ci.org/django-nose/django-nose I can also reproduce it locally with Python 3.4, Django 1.8.1, and SQLite with runtest.sh and |
Conflicts: django_nose/runner.py
@jwhitlock Rebased as requested! Tests pass :) |
@scottsexton ERROR: test suite for <class 'texparser.tests.test_views.TexparserTestCase'>Traceback (most recent call last): |
@shanukus98765 this has been merged into master, and is passing tests in TravisCI under Django 1.8 with a few database backends. I think it deserves a new issue to determine what is different under your setup. |
@jwhitlock Opened up a new issue. |
@shanukus98765 where is the issue you opened? I'm having a similar issue with Django 1.8 and Djang-Nose 1.4.3. Found it: #226 |
Stop using transaction.commit_unless_managed, and add keepdb kwarg to _skip_create_test_db().
#197