Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a test to show that #7227 was also fixed by [7778].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6d79ecc8b1f6c54c755c4c9cd1e9da11d533db96 1 parent bb21824
Malcolm Tredinnick authored June 29, 2008

Showing 1 changed file with 22 additions and 7 deletions. Show diff stats Hide diff stats

  1. 29  tests/regressiontests/queries/models.py
29  tests/regressiontests/queries/models.py
@@ -10,7 +10,8 @@
10 10
 
11 11
 class Tag(models.Model):
12 12
     name = models.CharField(max_length=10)
13  
-    parent = models.ForeignKey('self', blank=True, null=True)
  13
+    parent = models.ForeignKey('self', blank=True, null=True,
  14
+            related_name='children')
14 15
 
15 16
     def __unicode__(self):
16 17
         return self.name
@@ -25,6 +26,14 @@ class Meta:
25 26
     def __unicode__(self):
26 27
         return self.note
27 28
 
  29
+class Annotation(models.Model):
  30
+    name = models.CharField(max_length=10)
  31
+    tag = models.ForeignKey(Tag)
  32
+    notes = models.ManyToManyField(Note)
  33
+
  34
+    def __unicode__(self):
  35
+        return self.name
  36
+
28 37
 class ExtraInfo(models.Model):
29 38
     info = models.CharField(max_length=100)
30 39
     note = models.ForeignKey(Note)
@@ -236,12 +245,12 @@ class Child(models.Model):
236 245
 >>> c2 = Cover(title="second", item=i2)
237 246
 >>> c2.save()
238 247
 
239  
->>> n1 = Number(num=4)
240  
->>> n1.save()
241  
->>> n2 = Number(num=8)
242  
->>> n2.save()
243  
->>> n3 = Number(num=12)
244  
->>> n3.save()
  248
+>>> num1 = Number(num=4)
  249
+>>> num1.save()
  250
+>>> num2 = Number(num=8)
  251
+>>> num2.save()
  252
+>>> num3 = Number(num=12)
  253
+>>> num3.save()
245 254
 
246 255
 Bug #1050
247 256
 >>> Item.objects.filter(tags__isnull=True)
@@ -796,5 +805,11 @@ class Child(models.Model):
796 805
 this doesn't crash, it's a Good Thing.
797 806
 >>> out = pickle.dumps(Item.objects.all())
798 807
 
  808
+Bug #7277
  809
+>>> a1 = Annotation.objects.create(name='a1', tag=t1)
  810
+>>> a1.notes.add(n1)
  811
+>>> n1.annotation_set.filter(Q(tag=t5) | Q(tag__children=t5) | Q(tag__children__children=t5))
  812
+[<Annotation: a1>]
  813
+
799 814
 """}
800 815
 

0 notes on commit 6d79ecc

Please sign in to comment.
Something went wrong with that request. Please try again.