Public bug reported:

LP: #905837 described an incompatibility between Django and the latest
version of psycopg2.  The fix for that issue was applied in
1.3.1-4ubuntu1.  The problem is that the fix as applied does not solve
the issue if using the PostGIS database backend.  An additional one-line
fix (patch attached) is needed.

The symptom of this problem is that applications built using PostGIS are
unable to run any unit tests.  The error shown is:

  Got an error creating the test database: CREATE DATABASE cannot run
inside a transaction block

The fix involves changing the class inheritance of
django.contrib.gis.db.backends.postgis.creation.DatabaseCreation to
subclass the patched class from django.db.backends.postgresql_psycopg2
rather than django.db.backends.postgresql.

Django 1.4 removes django.db.backends.postgresql and renames
postgresql_psycopg2 to just postgresql, thus this fix is not needed for
newer versions.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-django 1.3.1-4ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.38-virtual 3.2.16
Uname: Linux 3.2.0-24-virtual x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Thu May 24 20:54:11 2012
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python-django
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: python-django (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug precise

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1004180

Title:
  Unable to run unit tests when using PostGIS database backend

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-django/+bug/1004180/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to