Skip to content

Commit 8af3ae4

Browse files
authored
Isolated test models for GeneratedFields.
Test regression in f333e35.
1 parent 23df37d commit 8af3ae4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/model_fields/test_generatedfield.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from django.db.models import F, FloatField, GeneratedField, IntegerField, Model
33
from django.db.models.functions import Lower
44
from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
5+
from django.test.utils import isolate_apps
56

67
from .models import (
78
GeneratedModel,
@@ -48,6 +49,7 @@ def test_deconstruct(self):
4849
self.assertEqual(args, [])
4950
self.assertEqual(kwargs, {"db_persist": True, "expression": F("a") + F("b")})
5051

52+
@isolate_apps("model_fields")
5153
def test_get_col(self):
5254
class Square(Model):
5355
side = IntegerField()
@@ -67,6 +69,7 @@ class FloatSquare(Model):
6769
col = FloatSquare._meta.get_field("area").get_col("alias")
6870
self.assertIsInstance(col.output_field, FloatField)
6971

72+
@isolate_apps("model_fields")
7073
def test_cached_col(self):
7174
class Sum(Model):
7275
a = IntegerField()

0 commit comments

Comments
 (0)