Skip to content

Commit

Permalink
Fixed test failure that was occurring since r12909
Browse files Browse the repository at this point in the history
  
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 r12909 was applied.

Backport of r12932 from trunk


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed Apr 6, 2010
1 parent c65dd48 commit 0819c29
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/modeltests/invalid_models/models.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class ValidM2M(models.Model):
# M2M fields are symmetrical by default. Symmetrical M2M fields # M2M fields are symmetrical by default. Symmetrical M2M fields
# on self don't require a related accessor, so many potential # on self don't require a related accessor, so many potential
# clashes are avoided. # clashes are avoided.
validm2m_set = models.ManyToManyField("ValidM2M") validm2m_set = models.ManyToManyField("self")


m2m_1 = models.ManyToManyField("ValidM2M", related_name='id') m2m_1 = models.ManyToManyField("self", related_name='id')
m2m_2 = models.ManyToManyField("ValidM2M", related_name='src_safe') m2m_2 = models.ManyToManyField("self", related_name='src_safe')


m2m_3 = models.ManyToManyField('self') m2m_3 = models.ManyToManyField('self')
m2m_4 = models.ManyToManyField('self') m2m_4 = models.ManyToManyField('self')
Expand All @@ -94,10 +94,10 @@ class SelfClashM2M(models.Model):


# Non-symmetrical M2M fields _do_ have related accessors, so # Non-symmetrical M2M fields _do_ have related accessors, so
# there is potential for clashes. # 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_1 = models.ManyToManyField("self", related_name='id', symmetrical=False)
m2m_2 = models.ManyToManyField("SelfClashM2M", related_name='src_safe', symmetrical=False) m2m_2 = models.ManyToManyField("self", related_name='src_safe', symmetrical=False)


m2m_3 = models.ManyToManyField('self', symmetrical=False) m2m_3 = models.ManyToManyField('self', symmetrical=False)
m2m_4 = models.ManyToManyField('self', symmetrical=False) m2m_4 = models.ManyToManyField('self', symmetrical=False)
Expand Down

0 comments on commit 0819c29

Please sign in to comment.