mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
This should allow smarter output_field inferring in functions dealing
with text expressions.
Regression in f333e3513e.
This commit is contained in:
committed by
Mariusz Felisiak
parent
5f2f12f61c
commit
8b1acc0440
@@ -842,6 +842,23 @@ class SchemaTests(TransactionTestCase):
|
||||
False,
|
||||
)
|
||||
|
||||
@isolate_apps("schema")
|
||||
@skipUnlessDBFeature("supports_stored_generated_columns")
|
||||
def test_add_generated_field_with_string_value(self):
|
||||
class GeneratedFieldStringValueModel(Model):
|
||||
value = GeneratedField(expression=Value("static string"), db_persist=True)
|
||||
|
||||
class Meta:
|
||||
app_label = "schema"
|
||||
|
||||
with CaptureQueriesContext(connection) as ctx:
|
||||
with connection.schema_editor() as editor:
|
||||
editor.create_model(GeneratedFieldStringValueModel)
|
||||
self.assertIs(
|
||||
any("None" in query["sql"] for query in ctx.captured_queries),
|
||||
False,
|
||||
)
|
||||
|
||||
@isolate_apps("schema")
|
||||
@skipUnlessDBFeature("supports_stored_generated_columns")
|
||||
def test_add_generated_field_with_output_field(self):
|
||||
|
||||
Reference in New Issue
Block a user