Permalink
Browse files

Fixed test failure that was occurring since r12909

  
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 0819c291e7284c589e5fca9cce774e3375e3b0cb
Showing with 6 additions and 6 deletions.
  1. +6 −6 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)

0 comments on commit 0819c29

Please sign in to comment.