lizardsystem/lizard-measure — Issue #20: local bin/test fails as it requires a specific PostGIS database
Author: swinkels
Created: 2012-02-22 08:24:37+00:00
State: open

After a buildout, bin/test fails and generates the traceback at the bottom of this message. The command fails as lizard_measure/testsettings.py specifies the use of a local PostGIS database, which may or may not be present.

The aforementioned traceback:

~/github.com/vss/src/lizard-measure $ bin/test
Traceback (most recent call last):
File "bin/test", line 69, in
djangorecipe.test.main('lizard_measure.testsettings', 'lizard_measure')
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/djangorecipe-0.99-py2.6.egg/djangorecipe/test.py", line 17, in main
management.execute_manager(settings, argv=argv)
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/core/management/__init__.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/django_nose-0.1.3-py2.6.egg/django_nose/__init__.py", line 4, in
from django_nose.runner import NoseTestSuiteRunner
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/django_nose-0.1.3-py2.6.egg/django_nose/runner.py", line 15, in
from django.test.simple import DjangoTestSuiteRunner
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/test/__init__.py", line 5, in
from django.test.client import Client, RequestFactory
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/test/client.py", line 27, in
from django.db import transaction, close_connection
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/db/__init__.py", line 78, in
connection = connections[DEFAULT_DB_ALIAS]
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/db/utils.py", line 94, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/contrib/gis/db/backends/postgis/base.py", line 11, in __init__
self.ops = PostGISOperations(self)
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/contrib/gis/db/backends/postgis/operations.py", line 91, in __init__
vtup = self.postgis_version_tuple()
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/contrib/gis/db/backends/postgis/operations.py", line 445, in postgis_version_tuple
version = self.postgis_lib_version()
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/contrib/gis/db/backends/postgis/operations.py", line 425, in postgis_lib_version
return self._get_postgis_func('postgis_lib_version')
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/contrib/gis/db/backends/postgis/operations.py", line 406, in _get_postgis_func
cursor = self.connection._cursor()
File "/home/pieter/github.com/vss/src/lizard-measure/eggs/Django-1.3.1-py2.6.egg/django/db/backends/postgresql_psycopg2/base.py", line 140, in _cursor
self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: FATAL: database "measure" does not exist