mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #31223 -- Added __class_getitem__() to Manager and QuerySet.
This commit is contained in:
parent
fc0b48d2e7
commit
578c03b276
4 changed files with 21 additions and 0 deletions
|
@ -1,7 +1,10 @@
|
|||
from unittest import skipUnless
|
||||
|
||||
from django.db import models
|
||||
from django.template import Context, Template
|
||||
from django.test import SimpleTestCase, TestCase, override_settings
|
||||
from django.test.utils import isolate_apps
|
||||
from django.utils.version import PY37
|
||||
|
||||
from .models import (
|
||||
AbstractBase1, AbstractBase2, AbstractBase3, Child1, Child2, Child3,
|
||||
|
@ -285,3 +288,7 @@ class TestManagerInheritance(SimpleTestCase):
|
|||
|
||||
self.assertEqual(TestModel._meta.managers, (TestModel.custom_manager,))
|
||||
self.assertEqual(TestModel._meta.managers_map, {'custom_manager': TestModel.custom_manager})
|
||||
|
||||
@skipUnless(PY37, '__class_getitem__() was added in Python 3.7')
|
||||
def test_manager_class_getitem(self):
|
||||
self.assertIs(models.Manager[Child1], models.Manager)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue