#14975: TransactionTestCases are broken by django.contrib.auth in 1.2.4
-------------------------------+--------------------------------------------
 Reporter:  rpbarlow           |       Owner:  nobody    
   Status:  new                |   Milestone:            
Component:  Testing framework  |     Version:  1.2       
 Keywords:                     |       Stage:  Unreviewed
Has_patch:  0                  |  
-------------------------------+--------------------------------------------
 I tried to upgrade my project to 1.2.4, and found that my
 TransactionTestCases were failing. I discovered that they would pass by
 themselves, but they would fail if I ran the django.contrib.auth tests
 first.

 I made a very simple Django project that has an app with a single
 TransactionTestCase. It runs a self.assertTrue(True). If you run the
 testapp test by itself, it will pass, but if you run the auth tests first,
 it will fail in this way:

 {{{
 ======================================================================
 ERROR: test_test (testapp.tests.SimpleTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/test/testcases.py", line 257, in __call__
     self._pre_setup()
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/test/testcases.py", line 224, in _pre_setup
     self._fixture_setup()
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/test/testcases.py", line 236, in _fixture_setup
     call_command('flush', verbosity=0, interactive=False, database=db)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/core/management/__init__.py", line 166, in call_command
     return klass.execute(*args, **defaults)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/core/management/base.py", line 220, in execute
     output = self.handle(*args, **options)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/core/management/base.py", line 351, in handle
     return self.handle_noargs(**options)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/core/management/commands/flush.py", line 75, in
 handle_noargs
     emit_post_sync_signal(all_models, verbosity, interactive, db)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/core/management/sql.py", line 182, in
 emit_post_sync_signal
     interactive=interactive, db=db)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/dispatch/dispatcher.py", line 172, in send
     response = receiver(signal=self, sender=sender, **named)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/contrib/auth/management/__init__.py", line 28, in
 create_permissions
     defaults={'name': name, 'content_type': ctype})
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/db/models/manager.py", line 135, in get_or_create
     return self.get_query_set().get_or_create(**kwargs)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/db/models/query.py", line 383, in get_or_create
     transaction.savepoint_rollback(sid, using=self.db)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/db/transaction.py", line 242, in savepoint_rollback
     connection._savepoint_rollback(sid)
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/db/backends/__init__.py", line 61, in _savepoint_rollback
     self.cursor().execute(self.ops.savepoint_rollback_sql(sid))
   File "/home/rbarlow/.virtualenvs/titles-db/lib/python2.6/site-
 packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in
 execute
     return self.cursor.execute(query, args)
 DatabaseError: no such savepoint
 }}}

 I put this into the Testing framework component, but it may be more
 appropriate in the Authentication component.

 Django rocks, thanks for working on it!

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14975>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to