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
This commit is contained in:
Ramiro Morales 2011-01-15 00:15:39 +00:00
parent ba585a2c6d
commit 0bd628d418
1 changed files with 12 additions and 2 deletions

View File

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