1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

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
This commit is contained in:
Ramiro Morales
2010-11-16 22:09:13 +00:00
parent ea145923fc
commit f3d0704783
2 changed files with 10 additions and 1 deletions

View File

@@ -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