#20198: fixtures.FixtureLoadingTests.test_loaddata_error_message fails on 
Postgres
9.2
-----------------------------------+--------------------
     Reporter:  clawlor            |      Owner:  nobody
         Type:  Bug                |     Status:  new
    Component:  Testing framework  |    Version:  master
     Severity:  Normal             |   Keywords:
 Triage Stage:  Unreviewed         |  Has patch:  1
Easy pickings:  0                  |      UI/UX:  0
-----------------------------------+--------------------
 Running the 'fixtures' tests against PostgreSQL 9.2.3 fails as follows:

 {{{
 ======================================================================
 FAIL: test_loaddata_error_message
 (modeltests.fixtures.tests.FixtureLoadingTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/clawlor/code/django/tests/modeltests/fixtures/tests.py",
 line 255, in test_loaddata_error_message
     management.call_command('loaddata', 'invalid.json', verbosity=0,
 commit=False)
 AssertionError: "Could not load fixtures.Article\(pk=1\): .*$" does not
 match "Problem installing fixture
 '/home/clawlor/code/django/tests/modeltests/fixtures/fixtures/invalid.json':
 Could not load fixtures.Article(pk=1): null value in column "pub_date"
 violates not-null constraint
 DETAIL:  Failing row contains (1, Breaking news, null).
 "

 ----------------------------------------------------------------------

 }}}


 The failure is due to the newline in the exception message after the word
 'constraint'. The test regex expects a match ending with ".*$", which does
 result in a match against a string containing a newline character that is
 not at the end of the string.

 This test does not fail against PostgreSQL 9.1. The version of psycopg2
 used does not matter.

 The behavior being tested is clearly not broken, this is a simple matter
 of updating the test regex. A patch is included which removes the "$"
 requirement.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20198>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to