From 0bd628d418348bbda936f10c03d5e9d910986580 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Sat, 15 Jan 2011 00:15:39 +0000 Subject: [PATCH] Enhanced slightly the tests added in r15185 to demonstrate that #14948 doesn't affect trunk. Refs #14948. Thanks Harm Geerts. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15208 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/multiple_database/tests.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py index a0a05b72b8..a8a2156237 100644 --- a/tests/regressiontests/multiple_database/tests.py +++ b/tests/regressiontests/multiple_database/tests.py @@ -1851,7 +1851,7 @@ class ModelMetaRouter(object): if not hasattr(model, '_meta'): raise ValueError -class RouterM2MThroughTestCase(TestCase): +class RouterModelArgumentTestCase(TestCase): multi_db = True def setUp(self): @@ -1861,7 +1861,7 @@ class RouterM2MThroughTestCase(TestCase): def tearDown(self): router.routers = self.old_routers - def test_m2m_through(self): + def test_m2m_collection(self): b = Book.objects.create(title="Pro Django", published=datetime.date(2008, 12, 16)) @@ -1872,3 +1872,13 @@ class RouterM2MThroughTestCase(TestCase): b.authors.remove(p) # test clear b.authors.clear() + # test setattr + b.authors = [p] + # test M2M collection + b.delete() + + def test_foreignkey_collection(self): + person = Person.objects.create(name='Bob') + pet = Pet.objects.create(owner=person, name='Wart') + # test related FK collection + person.delete()