MCPcopy
hub / github.com/django/django / test_add_db_comment_charfield

Method test_add_db_comment_charfield

tests/schema/tests.py:5000–5010  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4998
4999 @skipUnlessDBFeature("supports_comments")
5000 def test_add_db_comment_charfield(self):
5001 comment = "Custom comment"
5002 field = CharField(max_length=255, db_comment=comment)
5003 field.set_attributes_from_name("name_with_comment")
5004 with connection.schema_editor() as editor:
5005 editor.create_model(Author)
5006 editor.add_field(Author, field)
5007 self.assertEqual(
5008 self.get_column_comment(Author._meta.db_table, "name_with_comment"),
5009 comment,
5010 )
5011
5012 @skipUnlessDBFeature("supports_comments", "supports_stored_generated_columns")
5013 def test_add_db_comment_generated_field(self):

Callers

nothing calls this directly

Calls 6

get_column_commentMethod · 0.95
CharFieldClass · 0.90
schema_editorMethod · 0.80
create_modelMethod · 0.45
add_fieldMethod · 0.45

Tested by

no test coverage detected