summaryrefslogtreecommitdiff
path: root/tests/schema/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/schema/tests.py')
-rw-r--r--tests/schema/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index a16c4a6bfe..eeaa46af06 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -2306,6 +2306,19 @@ class SchemaTests(TransactionTestCase):
columns = self.column_classes(Author)
self.assertEqual(columns["birth_year"][1].default, "1988")
+ @isolate_apps("schema")
+ def test_add_text_field_with_db_default(self):
+ class Author(Model):
+ description = TextField(db_default="(missing)")
+
+ class Meta:
+ app_label = "schema"
+
+ with connection.schema_editor() as editor:
+ editor.create_model(Author)
+ columns = self.column_classes(Author)
+ self.assertIn("(missing)", columns["description"][1].default)
+
@skipUnlessDBFeature(
"supports_column_check_constraints", "can_introspect_check_constraints"
)