I’m trying to use django-test-utils to keep my database after test running.
But when I execute quicktest command:
python manage.py quicktest
I obtain this error:
re/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/apps/desarrollo/workspace/3sure-server/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/apps/desarrollo/workspace/3sure-server/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/apps/desarrollo/workspace/3sure-server/venv/local/lib/python2.7/site-packages/test_utils/management/commands/quicktest.py", line 30, in handle
failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive)
File "/apps/desarrollo/workspace/3sure-server/venv/local/lib/python2.7/site-packages/test_utils/test_runners/keep_database.py", line 30, in run_tests
setup_test_environment()
NameError: global name 'setup_test_environment' is not defined
I’ve installed django-test-utils using pip and referenced the application in my settings.py. Did I miss an installation step?
I’m using Django==1.4.3 and django-test-utils==0.3
Thank you.
This package is extremely old. It’s last specified support is Django 1.2. By looking at the error message and where
setup_test_environmentis called, I’m assuming thepipversion is even older.By looking at the source code on Github, you’ll see that the file
keep_database.pyhas been updated to importsetup_test_environmentspecifically:from django.test.utils import setup_test_environmentThis is not in the older versions of the code, which are probably the versions that you
pipinstalled – thus the error.Again, this project as a whole is old and you should find an alternative, but if you must use this project I suggest you get a fresh fork from the Github link above and manually install via
setup.py.