diff -r 9d422208c684 tests/modeltests/validation/models.py
--- a/tests/modeltests/validation/models.py	Sun Jan 30 23:29:31 2011 +0000
+++ b/tests/modeltests/validation/models.py	Mon Jan 31 16:27:10 2011 -0300
@@ -1,7 +1,6 @@
 from datetime import datetime
 from django.core.exceptions import ValidationError
 from django.db import models
-from django.test import TestCase
 
 
 def validate_answer_to_universe(value):
@@ -45,6 +44,15 @@
     order = models.IntegerField(unique_for_month="end_date")
     name = models.CharField(max_length=100)
 
+class UniqueForXModel(models.Model):
+    datetime1 = models.DateTimeField()
+    date1 = models.DateField()
+    date2 = models.DateField()
+    udate = models.IntegerField(unique_for_date="datetime1")
+    umonth = models.IntegerField(unique_for_month="date1")
+    uyear = models.IntegerField(unique_for_year="date2")
+    name = models.CharField(max_length=20)
+
 class CustomMessagesModel(models.Model):
     other  = models.IntegerField(blank=True, null=True)
     number = models.IntegerField(db_column='number_val',
diff -r 9d422208c684 tests/modeltests/validation/test_unique.py
--- a/tests/modeltests/validation/test_unique.py	Sun Jan 30 23:29:31 2011 +0000
+++ b/tests/modeltests/validation/test_unique.py	Mon Jan 31 16:27:10 2011 -0300
@@ -1,13 +1,11 @@
 import datetime
 
-from django.conf import settings
 from django.core.exceptions import ValidationError
-from django.db import connection
 from django.test import TestCase
 from django.utils import unittest
 
 from models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel,
-    UniqueForDateModel, ModelToValidate, Post, FlexibleDatePost)
+    UniqueForDateModel, ModelToValidate, Post, FlexibleDatePost, UniqueForXModel)
 
 
 class GetUniqueCheckTests(unittest.TestCase):
@@ -149,3 +147,150 @@
             self.fail("unique_for_month checks shouldn't trigger when the associated DateField is None.")
         except:
             self.fail("unique_for_month checks shouldn't explode when the associated DateField is None.")
+
+class UniqueMultiDbIsolationTests(TestCase):
+    multi_db = True
+
+    def test_unique_order1(self):
+        "Attempt to save two model instances that don't pass Field.unique checks to different DBs."
+        self._test_unique('default', 'other')
+
+    def test_unique_order2(self):
+        "Attempt to save two model instances that don't pass Field.unique checks to different DBs."
+        self._test_unique('other', 'default')
+
+    def test_unique_together_order1(self):
+        "Attempt to save two model instances that don't pass Meta.unique_together checks to different DBs."
+        self._test_unique_together('default', 'other')
+
+    def test_unique_together_order2(self):
+        "Attempt to save two model instances that don't pass Meta.unique_together checks to different DBs."
+        self._test_unique_together('other', 'default')
+
+    def test_unique_for_date_order1(self):
+        "Attempt to save two model instances that don't pass Field.unique_for_date checks to different DBs."
+        self._test_unique_for_date('default', 'other')
+
+    def test_unique_for_date_order2(self):
+        "Attempt to save two model instances that don't pass Field.unique_for_date checks to different DBs."
+        self._test_unique_for_date('other', 'default')
+
+    def test_unique_for_month_order1(self):
+        "Attempt to save two model instances that don't pass Field.unique_for_month checks to different DBs."
+        self._test_unique_for_month('default', 'other')
+
+    def test_unique_for_month_order2(self):
+        "Attempt to save two model instances that don't pass Field.unique_for_month checks to different DBs."
+        self._test_unique_for_month('other', 'default')
+
+    def test_unique_for_year_order1(self):
+        "Attempt to save two model instances that don't pass Field.unique_for_year checks to different DBs."
+        self._test_unique_for_year('default', 'other')
+
+    def test_unique_for_year_order2(self):
+        "Attempt to save two model instances that don't pass Field.unique_for_year checks to different DBs."
+        self._test_unique_for_year('other', 'default')
+
+    def _test_unique(self, first_db, second_db):
+        # Create a model instance in the first DB
+        UniqueFieldsModel(unique_charfield='Hello world', unique_integerfield=42, non_unique_field=3).save(using=first_db)
+        # Another different instance in the second DB so its internal state points to such DB
+        b = UniqueFieldsModel(unique_charfield='Bye world', unique_integerfield=0, non_unique_field=3)
+        b.save(using=second_db)
+        # Modify it to clash with the first instance
+        b.unique_charfield = 'Hello world'
+        b.unique_integerfield = 42
+        b.pk = None
+        try:
+            b.full_clean()
+        except ValidationError, e:
+            self.fail("unique field validation shouldn't erroneosuly trigger when the identical model instances are on different databases. Got: %s" % e)
+        else:
+            b.save()
+            self.assertEqual(UniqueFieldsModel.objects.using(first_db).count(), 1)
+            self.assertEqual(UniqueFieldsModel.objects.using(second_db).count(), 2)
+
+    def _test_unique_together(self, first_db, second_db):
+        # Create a model instance in the first DB
+        UniqueTogetherModel(cfield='Hello world', ifield=42, efield='user@example.org').save(using=first_db)
+        # Another different instance in the second DB so its internal state points to such DB
+        b = UniqueTogetherModel(cfield='Bye world', ifield=0, efield='user@example.com')
+        b.save(using=second_db)
+        # Modify it to clash with the first instance
+        b.cfield = 'Hello world'
+        b.ifield = 42
+        b.pk = None
+        try:
+            b.full_clean()
+        except ValidationError, e:
+            self.fail("Meta.unique_together validation shouldn't erroneosuly trigger when the identical model instances are on different databases. Got: %s" % e)
+        else:
+            b.save()
+            self.assertEqual(UniqueTogetherModel.objects.using(first_db).count(), 1)
+            self.assertEqual(UniqueTogetherModel.objects.using(second_db).count(), 2)
+
+    def _test_unique_for_date(self, first_db, second_db):
+        today = datetime.date.today()
+        now = datetime.datetime.now()
+        # Create a model instance in the first DB
+        UniqueForXModel(datetime1=now, date1=today, date2=today, udate=10, umonth=20, uyear=30, name='Foo').save(using=first_db)
+        # Another different instance in the second DB so its internal state points to such DB
+        b = UniqueForXModel(datetime1=now, date1=today, date2=today, udate=0, umonth=0, uyear=0, name='Bar')
+        b.save(using=second_db)
+        # Modify it to clash with the first instance
+        b.udate = 10
+        b.umonth = 2
+        b.uyear = 3
+        b.pk = None
+        try:
+            b.full_clean()
+        except ValidationError, e:
+            self.fail("Meta.unique_for_date validation shouldn't erroneosuly trigger when the identical model instances are on different databases. Got: %s" % e)
+        else:
+            b.save()
+            self.assertEqual(UniqueForXModel.objects.using(first_db).count(), 1)
+            self.assertEqual(UniqueForXModel.objects.using(second_db).count(), 2)
+
+    def _test_unique_for_month(self, first_db, second_db):
+        today = datetime.date.today()
+        now = datetime.datetime.now()
+        # Create a model instance in the first DB
+        UniqueForXModel(datetime1=now, date1=today, date2=today, udate=10, umonth=20, uyear=30, name='Foo').save(using=first_db)
+        # Another different instance in the second DB so its internal state points to such DB
+        b = UniqueForXModel(datetime1=now, date1=today, date2=today, udate=0, umonth=0, uyear=0, name='Bar')
+        b.save(using=second_db)
+        # Modify it to clash with the first instance
+        b.udate = 1
+        b.umonth = 20
+        b.uyear = 3
+        b.pk = None
+        try:
+            b.full_clean()
+        except ValidationError, e:
+            self.fail("Meta.unique_for_month validation shouldn't erroneosuly trigger when the identical model instances are on different databases. Got: %s" % e)
+        else:
+            b.save()
+            self.assertEqual(UniqueForXModel.objects.using(first_db).count(), 1)
+            self.assertEqual(UniqueForXModel.objects.using(second_db).count(), 2)
+
+    def _test_unique_for_year(self, first_db, second_db):
+        today = datetime.date.today()
+        now = datetime.datetime.now()
+        # Create a model instance in the first DB
+        UniqueForXModel(datetime1=now, date1=today, date2=today, udate=10, umonth=20, uyear=30, name='Foo').save(using=first_db)
+        # Another different instance in the second DB so its internal state points to such DB
+        b = UniqueForXModel(datetime1=now, date1=today, date2=today, udate=0, umonth=0, uyear=0, name='Bar')
+        b.save(using=second_db)
+        # Modify it to clash with the first instance
+        b.udate = 1
+        b.umonth = 2
+        b.uyear = 30
+        b.pk = None
+        try:
+            b.full_clean()
+        except ValidationError, e:
+            self.fail("Meta.unique_for_year validation shouldn't erroneosuly trigger when the identical model instances are on different databases. Got: %s" % e)
+        else:
+            b.save()
+            self.assertEqual(UniqueForXModel.objects.using(first_db).count(), 1)
+            self.assertEqual(UniqueForXModel.objects.using(second_db).count(), 2)
diff -r 9d422208c684 tests/modeltests/validation/tests.py
--- a/tests/modeltests/validation/tests.py	Sun Jan 30 23:29:31 2011 +0000
+++ b/tests/modeltests/validation/tests.py	Mon Jan 31 16:27:10 2011 -0300
@@ -7,7 +7,7 @@
 # Import other tests for this package.
 from modeltests.validation.validators import TestModelsWithValidators
 from modeltests.validation.test_unique import (GetUniqueCheckTests,
-    PerformUniqueChecksTest)
+    PerformUniqueChecksTest, UniqueMultiDbIsolationTests)
 from modeltests.validation.test_custom_messages import CustomMessagesTest
 
 
