1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Replaced vendor checks by three feature flags.

This commit is contained in:
Aymeric Augustin
2014-05-07 21:50:09 +02:00
parent 43a80f4812
commit c70a61eb49
7 changed files with 17 additions and 16 deletions

View File

@@ -605,6 +605,7 @@ 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:
@@ -619,10 +620,6 @@ class BinaryFieldTests(test.TestCase):
# Test default value
self.assertEqual(bytes(dm.short_data), b'\x08')
if connection.vendor == 'mysql' and six.PY3:
# Existing MySQL DB-API drivers fail on binary data.
test_set_and_retrieve = unittest.expectedFailure(test_set_and_retrieve)
def test_max_length(self):
dm = DataModel(short_data=self.binary_data * 4)
self.assertRaises(ValidationError, dm.full_clean)