1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[1.7.x] Replaced vendor checks by three feature flags.

Backport of c70a61eb from master
This commit is contained in:
Aymeric Augustin
2014-05-07 21:50:09 +02:00
parent 7f48d44c60
commit e3bc11cca9
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)