mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #29949 -- Refactored db introspection identifier converters.
Removed DatabaseIntrospection.table_name_converter()/column_name_converter() and use instead DatabaseIntrospection.identifier_converter(). Removed DatabaseFeatures.uppercases_column_names. Thanks Tim Graham for the initial patch and review and Simon Charette for the review.
This commit is contained in:
parent
2e4776196d
commit
d5f4ce9849
15 changed files with 64 additions and 76 deletions
|
@ -184,7 +184,7 @@ class InspectDBTestCase(TestCase):
|
|||
out = StringIO()
|
||||
call_command('inspectdb', table_name_filter=special_table_only, stdout=out)
|
||||
output = out.getvalue()
|
||||
base_name = 'field' if connection.features.uppercases_column_names else 'Field'
|
||||
base_name = connection.introspection.identifier_converter('Field')
|
||||
self.assertIn("field = models.IntegerField()", output)
|
||||
self.assertIn("field_field = models.IntegerField(db_column='%s_')" % base_name, output)
|
||||
self.assertIn("field_field_0 = models.IntegerField(db_column='%s__')" % base_name, output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue