diff --git a/tests/regressiontests/bug7872/__init__.py b/tests/regressiontests/bug7872/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/regressiontests/bug7872/models.py b/tests/regressiontests/bug7872/models.py
new file mode 100644
index 0000000..353cd57
-
|
+
|
|
| 1 | """ |
| 2 | Regression tests for #7872 |
| 3 | """ |
| 4 | |
| 5 | from django.db import models |
| 6 | from django.db.models import Q |
| 7 | |
| 8 | # Mixed forward and reverse joins, #7872 |
| 9 | class Ticket(models.Model): |
| 10 | creator = models.IntegerField() |
| 11 | |
| 12 | class Group(models.Model): |
| 13 | name = models.CharField(max_length=30) |
| 14 | |
| 15 | class Assignment(models.Model): |
| 16 | ticket = models.ForeignKey(Ticket) |
| 17 | group = models.ForeignKey(Group) |
| 18 | |
| 19 | |
| 20 | __test__ = {'API_TESTS':""" |
| 21 | >>> Ticket.objects.create(creator=1) |
| 22 | <Ticket: Ticket object> |
| 23 | >>> Ticket.objects.filter(Q(creator=1)|Q(assignment__group__name='fizz')) |
| 24 | <Ticket: Ticket object> |
| 25 | """} |