diff options
author | Claude Paroz <claude@2xlibre.net> | 2018-03-17 16:00:58 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-03-17 16:36:50 -0400 |
commit | aa0ee372cd6644b687e37dd63d8df9cc75f6121e (patch) | |
tree | fe8a51b9b4a09ed495c93ac9789903f6abc3a860 /tests/backends | |
parent | 77609f922e965b0df9db175b13389068529d3c6f (diff) | |
download | django-aa0ee372cd6644b687e37dd63d8df9cc75f6121e.tar.gz |
Added tests for MySQL's SchemaEditor.quote_value().
Diffstat (limited to 'tests/backends')
-rw-r--r-- | tests/backends/mysql/test_schema.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/backends/mysql/test_schema.py b/tests/backends/mysql/test_schema.py new file mode 100644 index 0000000000..b7c29f1b0d --- /dev/null +++ b/tests/backends/mysql/test_schema.py @@ -0,0 +1,18 @@ +import unittest + +from django.db import connection +from django.test import TestCase + + +@unittest.skipUnless(connection.vendor == 'mysql', 'MySQL tests') +class SchemaEditorTests(TestCase): + def test_quote_value(self): + editor = connection.schema_editor() + tested_values = [ + (42, '42'), + (1.754, '1.754'), + (False, '0'), + ] + for value, expected in tested_values: + with self.subTest(value=value): + self.assertEqual(editor.quote_value(value), expected) |