mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Added django.utils.six.buffer_types
and used it in the Oracle SchemaEditor. Refs #22715.
This commit is contained in:
		| @@ -24,8 +24,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): | ||||
|             return "'%s'" % value | ||||
|         elif isinstance(value, six.string_types): | ||||
|             return "'%s'" % six.text_type(value).replace("\'", "\'\'") | ||||
|         elif (isinstance(value, six.memoryview) or | ||||
|               six.PY3 and isinstance(value, bytes)): | ||||
|         elif isinstance(value, six.buffer_types): | ||||
|             return "'%s'" % force_text(binascii.hexlify(value)) | ||||
|         elif isinstance(value, bool): | ||||
|             return "1" if value else "0" | ||||
|   | ||||
| @@ -667,6 +667,7 @@ if PY3: | ||||
|     _assertRaisesRegex = "assertRaisesRegex" | ||||
|     _assertRegex = "assertRegex" | ||||
|     memoryview = memoryview | ||||
|     buffer_types = (bytes, bytearray, memoryview) | ||||
| else: | ||||
|     _assertCountEqual = "assertItemsEqual" | ||||
|     _assertRaisesRegex = "assertRaisesRegexp" | ||||
| @@ -678,6 +679,7 @@ else: | ||||
|         memoryview = memoryview | ||||
|     else: | ||||
|         memoryview = buffer | ||||
|     buffer_types = (bytearray, memoryview) | ||||
|  | ||||
|  | ||||
| def assertCountEqual(self, *args, **kwargs): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user