How can I make testcase for new migration feature (DB Comment) #18468

61 views
Skip to first unread message

SoungRyoul Kim

unread,
Jun 20, 2021, 3:09:55 AM6/20/21
to Django developers (Contributions to Django itself)
I think about how can I create testcase for DB Comment 

django already has test utility assertion like a  "assertTableExists" or "assertColumnExists" ,  Index, Constraint ....  etc... 

then. I think It seems appropriate that I make new assertion  "assertDBCommentExists"

but If  I make "assertDBCommentExists" , I needs to be modified to contain db Comment Info to  each "DatabaseIntrospection.get_table_description()"  


I would like to ask for advice on whether this is an appropriate way.

cc. jchubber

charettes

unread,
Jun 20, 2021, 10:44:57 AM6/20/21
to Django developers (Contributions to Django itself)
Hello there,

I confirm that you'll have to adapt get_table_description for each supported backends to introspect column comments.

It seems that introspection support was considered to be a requirement for this ticket[0]. Not sure if that means that the inspectdb logic also needs to be adapted to generate fields with db_comment attached to them.

Cheers,
Simon
Reply all
Reply to author
Forward
0 new messages