1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[5.0.x] Reverted "Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value()."

This reverts commit 8b1acc0440.

Backport of de4884b114 from main
This commit is contained in:
Mariusz Felisiak
2023-11-12 20:34:10 +01:00
parent 7a21ea5464
commit 5b1d0a6be0
3 changed files with 1 additions and 19 deletions

View File

@@ -848,23 +848,6 @@ 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):