From 68a439a18da17a65555832eff0a7c2090655b583 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sun, 11 Jan 2015 21:18:56 +0100 Subject: [PATCH] Removed supports_binary_field flag as all backends support them It was mainly for MySQL on Python 3, but now the current recommended MySQL driver for Python 3 (mysqlclient) does support binary fields, it is unneeded. Refs #20377. --- django/db/backends/__init__.py | 2 -- django/db/backends/mysql/base.py | 2 -- tests/migrations/test_operations.py | 2 -- tests/model_fields/tests.py | 1 - tests/serializers_regress/tests.py | 1 - 5 files changed, 8 deletions(-) diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 6c675cb482..1c4904a893 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -581,8 +581,6 @@ class BaseDatabaseFeatures(object): supports_subqueries_in_group_by = True supports_bitwise_or = True - supports_binary_field = True - # Is there a true datatype for timedeltas? has_native_duration_field = False diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index d4117ec724..73a5acc7d1 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -169,8 +169,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): has_select_for_update = True has_select_for_update_nowait = False supports_forward_references = False - # XXX MySQL DB-API drivers currently fail on binary data on Python 3. - supports_binary_field = six.PY2 supports_regex_backreferencing = False supports_date_lookup_using_string = False can_introspect_autofield = True diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index a491d9c280..12fd807bae 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -7,7 +7,6 @@ try: except ImportError: sqlparse = None -from django import test from django.db import connection, migrations, models, transaction from django.db.migrations.migration import Migration from django.db.migrations.state import ProjectState @@ -669,7 +668,6 @@ class OperationTests(OperationTestBase): self.assertEqual(pony.digits, "42") self.assertEqual(pony.quotes, '"\'"') - @test.skipUnlessDBFeature('supports_binary_field') def test_add_binaryfield(self): """ Tests the AddField operation on TextField/BinaryField. diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 9ef46006e1..897359c0cf 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -655,7 +655,6 @@ class FileFieldTests(unittest.TestCase): class BinaryFieldTests(test.TestCase): binary_data = b'\x00\x46\xFE' - @test.skipUnlessDBFeature('supports_binary_field') def test_set_and_retrieve(self): data_set = (self.binary_data, six.memoryview(self.binary_data)) for bdata in data_set: diff --git a/tests/serializers_regress/tests.py b/tests/serializers_regress/tests.py index 15ecadaba9..2c99ed77b3 100644 --- a/tests/serializers_regress/tests.py +++ b/tests/serializers_regress/tests.py @@ -450,7 +450,6 @@ class SerializerTests(TestCase): self.assertEqual(base_data, proxy_proxy_data.replace('proxy', '')) -@skipUnlessDBFeature('supports_binary_field') def serializerTest(format, self): # Create all the objects defined in the test data