mirror of
https://github.com/django/django.git
synced 2025-11-22 12:14:45 +00:00
Fixed #35344, Refs #34838 -- Corrected output_field of resolved columns for GeneratedFields in aliased tables.
Thanks Simon Charette for the review.
This commit is contained in:
parent
425b26092f
commit
5f18021640
4 changed files with 17 additions and 3 deletions
|
|
@ -123,7 +123,12 @@ class BaseGeneratedFieldTests(SimpleTestCase):
|
|||
db_persist=True,
|
||||
)
|
||||
|
||||
col = Square._meta.get_field("area").get_col("alias")
|
||||
field = Square._meta.get_field("area")
|
||||
|
||||
col = field.get_col("alias")
|
||||
self.assertIsInstance(col.output_field, IntegerField)
|
||||
|
||||
col = field.get_col("alias", field)
|
||||
self.assertIsInstance(col.output_field, IntegerField)
|
||||
|
||||
class FloatSquare(Model):
|
||||
|
|
@ -134,7 +139,12 @@ class BaseGeneratedFieldTests(SimpleTestCase):
|
|||
output_field=FloatField(),
|
||||
)
|
||||
|
||||
col = FloatSquare._meta.get_field("area").get_col("alias")
|
||||
field = FloatSquare._meta.get_field("area")
|
||||
|
||||
col = field.get_col("alias")
|
||||
self.assertIsInstance(col.output_field, FloatField)
|
||||
|
||||
col = field.get_col("alias", field)
|
||||
self.assertIsInstance(col.output_field, FloatField)
|
||||
|
||||
@isolate_apps("model_fields")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue