1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #31223 -- Added __class_getitem__() to ForeignKey.

This commit is contained in:
Collin Anderson
2022-04-22 08:13:12 -04:00
committed by GitHub
parent eeb0bb6379
commit 0de89b6f8d
2 changed files with 6 additions and 0 deletions

View File

@@ -164,3 +164,6 @@ class ForeignKeyTests(TestCase):
class MyModel(models.Model):
child = models.ForeignKey(1, models.CASCADE)
def test_manager_class_getitem(self):
self.assertIs(models.ForeignKey["Foo"], models.ForeignKey)