Enable postponed evaluation of annotations for all test modules

This allows using the latest annotation syntax supported by the type
checker regardless of the runtime Python version.
This commit is contained in:
Maarten ter Huurne 2023-03-21 14:21:03 +01:00
parent 713a3fec88
commit aeeb69a9dd
20 changed files with 40 additions and 0 deletions

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.db import models

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from model_utils import Choices

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from datetime import datetime, timezone
import time_machine

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from tests.models import Article, SplitFieldAbstractParent

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from model_utils.fields import StatusField

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from unittest.mock import Mock
from django.db.models import NOT_PROVIDED

View file

@ -1,3 +1,5 @@
from __future__ import annotations
import uuid
from django.core.exceptions import ValidationError

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.db.models import Prefetch
from django.test import TestCase

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.db import models
from django.test import TestCase

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from tests.models import BoxJoinModel, JoinItemForeignKey

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from tests.models import Post

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from tests.models import CustomSoftDelete

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.test import TestCase

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.core.management import call_command
from django.test import TestCase

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from tests.models import ModelWithCustomDescriptor

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from django.utils.connection import ConnectionDoesNotExist

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from datetime import datetime, timezone
import time_machine

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from datetime import datetime, timedelta
from django.core.exceptions import ImproperlyConfigured

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from datetime import datetime, timedelta, timezone
import time_machine

View file

@ -1,3 +1,5 @@
from __future__ import annotations
from django.test import TestCase
from tests.models import CustomNotPrimaryUUIDModel, CustomUUIDModel