#12766: custom_pk test fails with psycopg1 backend
---------------------------------------------------+------------------------
          Reporter:  kmtracey                      |         Owner:  nobody
            Status:  new                           |     Milestone:  1.2   
         Component:  Database layer (models, ORM)  |       Version:  SVN   
        Resolution:                                |      Keywords:        
             Stage:  Unreviewed                    |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by kmtracey):

 Note these tests all fail prior to r12352; these errors were not
 introduced by the implementation of a common class for database errors.
 With r12351 results show psycopg1 is raising !ProgrammingError where
 !IntegrityError is expected by the tests.  For example:

 {{{
 F
 ======================================================================
 FAIL: Doctest: modeltests.custom_pk.models.__test__.API_TESTS
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "d:\u\kmt\django\trunk\django\test\_doctest.py", line 2180, in
 runTest
     raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 modeltests.custom_pk.models.__test__.API_TESTS
   File "D:\u\kmt\django\trunk\tests\modeltests\custom_pk\models.py", line
 unknown line number, in API_TESTS

 ----------------------------------------------------------------------
 File "D:\u\kmt\django\trunk\tests\modeltests\custom_pk\models.py", line ?,
 in modeltests.custom_pk.models.__test__.API_TESTS
 Failed example:
     try:
        sid = transaction.savepoint()
        Employee.objects.create(employee_code=123, first_name='Fred',
 last_name='Jones')
        transaction.savepoint_commit(sid)
     except Exception, e:
        if isinstance(e, IntegrityError):
            transaction.savepoint_rollback(sid)
            print "Pass"
        else:
            print "Fail with %s" % type(e)
 Expected:
     Pass
 Got:
     Fail with <class 'psycopg.ProgrammingError'>
 ----------------------------------------------------------------------
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12766#comment:2>
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