From 21236fa0a2dc37126cc93eb1a8f849002000cbe6 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Tue, 6 Apr 2010 12:18:56 +0000 Subject: [PATCH] Fixed test failure that was occurring since r12908 The tests were relying on being able to do ManyToManyField("NameOfThisModel") instead of the only documented method for recursive relationships, namely ManyToManyField("self"). The former stopped working when the fix in r12908 was applied. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12932 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/invalid_models/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/modeltests/invalid_models/models.py b/tests/modeltests/invalid_models/models.py index 570b6bf65e..b263390c39 100644 --- a/tests/modeltests/invalid_models/models.py +++ b/tests/modeltests/invalid_models/models.py @@ -80,10 +80,10 @@ class ValidM2M(models.Model): # M2M fields are symmetrical by default. Symmetrical M2M fields # on self don't require a related accessor, so many potential # clashes are avoided. - validm2m_set = models.ManyToManyField("ValidM2M") + validm2m_set = models.ManyToManyField("self") - m2m_1 = models.ManyToManyField("ValidM2M", related_name='id') - m2m_2 = models.ManyToManyField("ValidM2M", related_name='src_safe') + m2m_1 = models.ManyToManyField("self", related_name='id') + m2m_2 = models.ManyToManyField("self", related_name='src_safe') m2m_3 = models.ManyToManyField('self') m2m_4 = models.ManyToManyField('self') @@ -94,10 +94,10 @@ class SelfClashM2M(models.Model): # Non-symmetrical M2M fields _do_ have related accessors, so # there is potential for clashes. - selfclashm2m_set = models.ManyToManyField("SelfClashM2M", symmetrical=False) + selfclashm2m_set = models.ManyToManyField("self", symmetrical=False) - m2m_1 = models.ManyToManyField("SelfClashM2M", related_name='id', symmetrical=False) - m2m_2 = models.ManyToManyField("SelfClashM2M", related_name='src_safe', symmetrical=False) + m2m_1 = models.ManyToManyField("self", related_name='id', symmetrical=False) + m2m_2 = models.ManyToManyField("self", related_name='src_safe', symmetrical=False) m2m_3 = models.ManyToManyField('self', symmetrical=False) m2m_4 = models.ManyToManyField('self', symmetrical=False)