#2705: [patch] Add optional FOR UPDATE clause to QuerySets
---------------------------------------------------+------------------------
          Reporter:  Hawkeye                       |         Owner:  brunobraga
            Status:  assigned                      |     Milestone:            
         Component:  Database layer (models, ORM)  |       Version:  SVN       
        Resolution:                                |      Keywords:            
             Stage:  Accepted                      |     Has_patch:  1         
        Needs_docs:  0                             |   Needs_tests:  0         
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by jacob):

 Tests are failing for me - psycopg2, PostgreSQL 9:

 {{{
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 Destroying old test database 'other'...
 ...Exception in thread Thread-2:
 Traceback (most recent call last):
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py",
 line 522, in __bootstrap_inner
     self.run()
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py",
 line 477, in run
     self.__target(*self.__args, **self.__kwargs)
   File
 
"/Users/jacob/Projects/Django/upstream/tests/modeltests/select_for_update/tests.py",
 line 117, in run_select_for_update
     people[0].name = 'Fred'
 IndexError: list index out of range

 F...
 ======================================================================
 FAIL: test_nowait_raises_error_on_block
 (modeltests.select_for_update.tests.SelectForUpdateTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/jacob/Projects/Django/upstream/django/test/testcases.py",
 line 613, in skip_wrapper
     return test_func(*args, **kwargs)
   File
 
"/Users/jacob/Projects/Django/upstream/tests/modeltests/select_for_update/tests.py",
 line 110, in test_nowait_raises_error_on_block
     self.check_exc(status[-1])
   File
 
"/Users/jacob/Projects/Django/upstream/tests/modeltests/select_for_update/tests.py",
 line 71, in check_exc
     self.failUnless(isinstance(exc, DatabaseError))
 AssertionError: False is not True

 ----------------------------------------------------------------------
 Ran 7 tests in 3.796s

 FAILED (failures=1)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 }}}

 I'm trying to fix, but I can't seem to work out how this test is supposed
 to work or what it's doing. `SelectForUpdateTests.setUp()` creates a
 `Person`, but `SelectForUpdateTests.run_select_for_update()` calls
 `connection._rollback()` right off the bat, so where's that `Person` in
 the list on line 116 supposed to come from?

 I'd really like to check this in, but feature freeze is rapidly
 approaching. The rest of the patch looks good, but if I can't work out
 what the tests are doing, I can't be comfortable checking this in.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2705#comment:71>
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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to