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()