summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-11-12 20:34:10 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-11-14 15:46:23 +0100
commit5b1d0a6be06a14d130b2b7fa305dbc9e2a393761 (patch)
tree79d8663b3e6cad7d4592f6676c3476e3f85eab4c /tests
parent7a21ea5464b61a8fcd43cd1b9b5f99c94687600a (diff)
[5.0.x] Reverted "Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value()."
This reverts commit 8b1acc0440418ac8f45ba48e2dfcf5126c83341b. Backport of de4884b114534f43c49cf8c5b7f10181e737f4e9 from main
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions/tests.py1
-rw-r--r--tests/schema/tests.py17
2 files changed, 0 insertions, 18 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index 9743d024b1..073e2e9258 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -2227,7 +2227,6 @@ class ValueTests(TestCase):
with self.subTest(type=type(value)):
expr = Value(value)
self.assertIsInstance(expr.output_field, output_field_type)
- self.assertEqual(Value("foo").output_field.max_length, 3)
def test_resolve_output_field_failure(self):
msg = "Cannot resolve expression type, unknown output_field"
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 5488013bfc..e1e3c7d3c6 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -850,23 +850,6 @@ class SchemaTests(TransactionTestCase):
@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):
class GeneratedFieldOutputFieldModel(Model):
price = DecimalField(max_digits=7, decimal_places=2)