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

KeyError: 'SUPPORTS_TRANSACTIONS' #6

Open
ramusus opened this issue Jan 10, 2010 · 7 comments
Open

KeyError: 'SUPPORTS_TRANSACTIONS' #6

ramusus opened this issue Jan 10, 2010 · 7 comments

Comments

@ramusus
Copy link

ramusus commented Jan 10, 2010

When I try to execute quicktest with specific app I get error:

ram@ram-laptop:~/workspace/movister/web_site$ ./manage.py quicktest movister
E
Traceback (most recent call last):
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 256, in __call__
    self._pre_setup()
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 223, in _pre_setup
    self._fixture_setup()
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 461, in _fixture_setup
    if not connections_support_transactions():
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 450, in connections_support_transactions
    for conn in connections.all())
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 450, in <genexpr>
    for conn in connections.all())
KeyError: 'SUPPORTS_TRANSACTIONS'

DB - Postgres 8.4

DATABASE_ENGINE = 'postgresql_psycopg2'
@ericholscher
Copy link
Owner

Hmm, wonder if this is related to multidb? It works under my setup with postgres 8.3. What version of django are you running against?

@ramusus
Copy link
Author

ramusus commented Jan 18, 2010

I use development version of django from trunk. I tried another time with r12228 - error still here. Also my version of postgres is 8.4

@phoebebright
Copy link

Same problem running django 1.2 beta and mysql

@joelryan2k
Copy link

It was a fairly easy patch to get this working with Django 1.2

Download here: http://iwcenter.com/files/0001-Made-this-work-against-django-1.2.patch

@ericholscher
Copy link
Owner

Thanks for the patch joel, I applied it to a 1.2 compat branch. I don't know a good way of supporting this on both versions, I guess just a bunch of if statements and such. I'll hopefully look more at it this weekend and get it into trunk so it'll work on 1.1 and 1.2

@denivorium
Copy link

joelryan2k's patch didn't work for my particular postgres installation. The cursor = connection.cursor() line in the try block was returning a cursor for my main db not the test db. And thus the create_test_db() was never getting called.

When I added connection.close() to the line before then I was getting an exception, but it was an OperationalError, not a DatabaseError. My temp solution is to make the except block catch ALL exceptions. Not great but it works.

Also I'm running Django 1.2.1 release and Postgres 8.4

@arowla
Copy link

arowla commented Oct 14, 2010

I just created a brand new Django 1.2.3 project with a sqlite3 database, ran its one default test, and got the same error.

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

6 participants