diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -255,6 +255,11 @@
     def make_debug_cursor(self, cursor):
         return util.CursorDebugWrapper(cursor, self)
 
+    def check_constraints(self):
+        sql = self.ops.check_constraints_sql()
+        for s in sql:
+            self.cursor().execute(s)
+
 class BaseDatabaseFeatures(object):
     allows_group_by_pk = False
     # True if django.db.backend.utils.typecast_timestamp is used on values
@@ -440,6 +445,12 @@
         """
         return ''
 
+    def check_constraints_sql(self):
+        """
+        Returns the SQL necessary to force deferred constraints to be checked.
+        """
+        return []
+
     def drop_foreignkey_sql(self):
         """
         Returns the SQL command that drops a foreign key.
diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py
--- a/django/db/backends/postgresql_psycopg2/operations.py
+++ b/django/db/backends/postgresql_psycopg2/operations.py
@@ -39,6 +39,9 @@
     def deferrable_sql(self):
         return " DEFERRABLE INITIALLY DEFERRED"
 
+    def check_constraints_sql(self):
+        return ["SET CONSTRAINTS ALL IMMEDIATE"]
+
     def lookup_cast(self, lookup_type):
         lookup = '%s'
 
diff --git a/django/test/testcases.py b/django/test/testcases.py
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -13,6 +13,7 @@
 from django.core.urlresolvers import clear_url_caches
 from django.db import (transaction, connection, connections, DEFAULT_DB_ALIAS,
     reset_queries)
+from django.db.utils import IntegrityError
 from django.http import QueryDict
 from django.test import _doctest as doctest
 from django.test.client import Client
@@ -298,7 +299,7 @@
             return
         super(TransactionTestCase, self).__call__(result)
         try:
-            self._post_teardown()
+            self._post_teardown(result)
         except (KeyboardInterrupt, SystemExit):
             raise
         except Exception:
@@ -306,14 +307,15 @@
             result.addError(self, sys.exc_info())
             return
 
-    def _post_teardown(self):
+    def _post_teardown(self, result):
         """ Performs any post-test things. This includes:
 
+            * Tearing down database fixtures, if any.
             * Putting back the original ROOT_URLCONF if it was changed.
             * Force closing the connection, so that the next test gets
               a clean cursor.
         """
-        self._fixture_teardown()
+        self._fixture_teardown(result)
         self._urlconf_teardown()
         # Some DB cursors include SQL statements as part of cursor
         # creation. If you have a test that does rollback, the effect
@@ -325,7 +327,7 @@
         for connection in connections.all():
             connection.close()
 
-    def _fixture_teardown(self):
+    def _fixture_teardown(self, result):
         pass
 
     def _urlconf_teardown(self):
@@ -589,7 +591,7 @@
                                                             'database': db
                                                             })
 
-    def _fixture_teardown(self):
+    def _fixture_teardown(self, result):
         if not connections_support_transactions():
             return super(TestCase, self)._fixture_teardown()
 
@@ -602,8 +604,15 @@
 
         restore_transaction_methods()
         for db in databases:
-            transaction.rollback(using=db)
-            transaction.leave_transaction_management(using=db)
+            # Force constraints check execution (on backends that support
+            # deferring them) before rolling back the transaction.
+            try:
+                connections[db].check_constraints()
+            except IntegrityError:
+                result.addError(self, sys.exc_info())
+            finally:
+                transaction.rollback(using=db)
+                transaction.leave_transaction_management(using=db)
 
 def _deferredSkip(condition, reason):
     def decorator(test_func):
diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py
--- a/tests/regressiontests/multiple_database/tests.py
+++ b/tests/regressiontests/multiple_database/tests.py
@@ -1465,7 +1465,11 @@
                                                  published=datetime.date(2008, 12, 16))
 
         marty = Person.objects.using('other').create(pk=1, name="Marty Alchin")
-        pro.authors = [marty]
+        # Per the router in effect, writes go to the 'default' DB and so the
+        # manager will create m2m relationships on that DB. Derive a new manager
+        # associated with the 'other' DB so we don't create cross-DB FKs
+        author_m2m_manager_in_other_db = pro.authors.db_manager('other')
+        author_m2m_manager_in_other_db = [marty]
 
         self.assertEqual(pro.authors.db, 'other')
         self.assertEqual(pro.authors.db_manager('default').db, 'default')
