From f3d07047834b0a4ea3bde2b46643b327a659364e Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Tue, 16 Nov 2010 22:09:13 +0000 Subject: Fixed #14691 -- Made ForeignKey.validate() use the right database. Thanks Marco Paolini for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14580 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/multiple_database/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/regressiontests/multiple_database') diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py index 22ee74c697..04ab2bb925 100644 --- a/tests/regressiontests/multiple_database/tests.py +++ b/tests/regressiontests/multiple_database/tests.py @@ -581,6 +581,12 @@ class QueryTestCase(TestCase): self.assertEquals(Person.objects.using('other').count(), 0) self.assertEquals(Pet.objects.using('other').count(), 0) + def test_foreign_key_validation(self): + "ForeignKey.validate() uses the correct database" + mickey = Person.objects.using('other').create(name="Mickey") + pluto = Pet.objects.using('other').create(name="Pluto", owner=mickey) + self.assertEquals(None, pluto.full_clean()) + def test_o2o_separation(self): "OneToOne fields are constrained to a single database" # Create a user and profile on the default database -- cgit v1.3