diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-09-19 08:09:03 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-09-19 08:10:03 +0200 |
| commit | b5b361ab3bdd4d415e38a85fc27b9e333387c82d (patch) | |
| tree | a6e247b7fdf001cbed835646a76e133505235a3a /tests | |
| parent | eeeacc52a967234e920c001b7908c4acdfd7a848 (diff) | |
[5.0.x] Isolated test models for GeneratedFields.
Test regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
Backport of 8af3ae4ad9ca475f2428fac950de8df56b575e6a from main
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/model_fields/test_generatedfield.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/model_fields/test_generatedfield.py b/tests/model_fields/test_generatedfield.py index 0d81cb8281..3184f77d87 100644 --- a/tests/model_fields/test_generatedfield.py +++ b/tests/model_fields/test_generatedfield.py @@ -2,6 +2,7 @@ from django.db import IntegrityError, connection from django.db.models import F, FloatField, GeneratedField, IntegerField, Model from django.db.models.functions import Lower from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature +from django.test.utils import isolate_apps from .models import ( GeneratedModel, @@ -48,6 +49,7 @@ class BaseGeneratedFieldTests(SimpleTestCase): self.assertEqual(args, []) self.assertEqual(kwargs, {"db_persist": True, "expression": F("a") + F("b")}) + @isolate_apps("model_fields") def test_get_col(self): class Square(Model): side = IntegerField() @@ -67,6 +69,7 @@ class BaseGeneratedFieldTests(SimpleTestCase): col = FloatSquare._meta.get_field("area").get_col("alias") self.assertIsInstance(col.output_field, FloatField) + @isolate_apps("model_fields") def test_cached_col(self): class Sum(Model): a = IntegerField() |
