Index: tests/modeltests/fixtures/tests.py
===================================================================
--- tests/modeltests/fixtures/tests.py	(revision 17825)
+++ tests/modeltests/fixtures/tests.py	(working copy)
@@ -5,6 +5,7 @@
 from django.contrib.sites.models import Site
 from django.core import management
 from django.db import connection
+from django.db import IntegrityError
 from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
 
 from .models import Article, Book, Spy, Tag, Visa
@@ -258,10 +259,11 @@
         # is closed at the end of each test.
         if connection.vendor == 'mysql':
             connection.cursor().execute("SET sql_mode = 'TRADITIONAL'")
-        new_io = StringIO.StringIO()
-        management.call_command('loaddata', 'invalid.json', verbosity=0, stderr=new_io, commit=False)
-        output = new_io.getvalue().strip().split('\n')
-        self.assertRegexpMatches(output[-1], "Error: Could not load fixtures.Article\(pk=1\): .*$")
+        with self.assertRaisesRegexp(
+            IntegrityError,
+            '^Could not load fixtures.Article\(pk=1\): fixtures_article.pub_date may not be NULL$'
+        ):
+            management.call_command('loaddata', 'invalid.json', verbosity=0, commit=False)
 
     def test_loading_using(self):
         # Load db fixtures 1 and 2. These will load using the 'default' database identifier explicitly
