Set straight the sense of 'uppercases_column_names' feature flag

This commit is contained in:
Shai Berger 2014-05-28 21:16:24 +03:00
parent 7e3cf3cfd2
commit 69337d485c
3 changed files with 3 additions and 3 deletions

View File

@ -649,7 +649,7 @@ class BaseDatabaseFeatures(object):
# If NULL is implied on columns without needing to be explicitly specified # If NULL is implied on columns without needing to be explicitly specified
implied_column_null = False implied_column_null = False
uppercases_column_names = True uppercases_column_names = False
def __init__(self, connection): def __init__(self, connection):
self.connection = connection self.connection = connection

View File

@ -120,7 +120,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
connection_persists_old_columns = True connection_persists_old_columns = True
closed_cursor_error_class = InterfaceError closed_cursor_error_class = InterfaceError
bare_select_suffix = " FROM DUAL" bare_select_suffix = " FROM DUAL"
uppercases_column_names = False uppercases_column_names = True
class DatabaseOperations(BaseDatabaseOperations): class DatabaseOperations(BaseDatabaseOperations):

View File

@ -176,7 +176,7 @@ class InspectDBTestCase(TestCase):
out = StringIO() out = StringIO()
call_command('inspectdb', stdout=out) call_command('inspectdb', stdout=out)
output = out.getvalue() output = out.getvalue()
base_name = 'field' if not connection.features.uppercases_column_names else 'Field' base_name = 'Field' if not connection.features.uppercases_column_names else 'field'
self.assertIn("field = models.IntegerField()", output) self.assertIn("field = models.IntegerField()", output)
self.assertIn("field_field = models.IntegerField(db_column='%s_')" % base_name, 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) self.assertIn("field_field_0 = models.IntegerField(db_column='%s__')" % base_name, output)