Fixed a failing schema assertion.

BooleanFields are stored as TINYINT(1) on MySQL.
This commit is contained in:
Simon Charette 2014-01-25 10:59:38 -05:00
parent b9e0ea3cb4
commit 3acdb3068a
1 changed files with 7 additions and 1 deletions

View File

@ -209,7 +209,13 @@ class SchemaTests(TransactionTestCase):
)
# Ensure the field is right afterwards
columns = self.column_classes(Author)
self.assertEqual(columns['awesome'][0], "BooleanField")
# BooleanField are stored as TINYINT(1) on MySQL.
field_type, field_info = columns['awesome']
if connection.vendor == 'mysql':
self.assertEqual(field_type, 'IntegerField')
self.assertEqual(field_info.precision, 1)
else:
self.assertEqual(field_type, 'BooleanField')
def test_alter(self):
"""