mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[5.0.x] Fixed #34877 -- Fixed migrations crash when adding GeneratedField with output_field with params.
Backport of e7e8eb44a3 from main
This commit is contained in:
committed by
Mariusz Felisiak
parent
0ca421c5aa
commit
0f9d07398d
@@ -181,6 +181,13 @@ class GeneratedFieldTestMixin:
|
||||
field._resolved_expression.output_field.db_type(connection),
|
||||
)
|
||||
|
||||
@skipUnlessDBFeature("supports_collation_on_charfield")
|
||||
def test_db_type_parameters(self):
|
||||
db_type_parameters = self.output_field_model._meta.get_field(
|
||||
"lower_name"
|
||||
).db_type_parameters(connection)
|
||||
self.assertEqual(db_type_parameters["max_length"], 11)
|
||||
|
||||
def test_model_with_params(self):
|
||||
m = self.params_model.objects.create()
|
||||
m = self._refresh_if_needed(m)
|
||||
|
||||
Reference in New Issue
Block a user