diff --git a/tests/issue24505/__init__.py b/tests/issue24505/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/issue24505/models.py b/tests/issue24505/models.py
new file mode 100644
index 0000000..49aa276
-
|
+
|
|
| 1 | from django.db import models |
| 2 | |
| 3 | class Foo(models.Model): |
| 4 | def __str__(self): |
| 5 | return str(self.pk) |
| 6 | |
| 7 | |
| 8 | class Bar(models.Model): |
| 9 | foos1 = models.ManyToManyField(Foo, related_name='+') |
| 10 | foos2 = models.ManyToManyField(Foo, related_name='+') |
diff --git a/tests/issue24505/tests.py b/tests/issue24505/tests.py
new file mode 100644
index 0000000..0dace0a
-
|
+
|
|
| 1 | from django.test import TestCase |
| 2 | |
| 3 | from .models import Foo, Bar |
| 4 | |
| 5 | class ReproTestCase(TestCase): |
| 6 | def test_24505(self): |
| 7 | f = Foo.objects.create() |
| 8 | b = Bar.objects.create() |
| 9 | |
| 10 | b.foos1.add(f) |
| 11 | |
| 12 | self.assertQuerysetEqual(b.foos1.all(), ['<Foo: 1>']) |