From 7476d96f83a004d674244aeb7a66289035427396 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 8 May 2013 15:33:02 +0200 Subject: Marked tests of BinaryFields as expected failures on MySQL and Python 3. Current ports of MySQLdb are very buggy in this area. --- tests/model_fields/tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/model_fields/tests.py') diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 9af8325040..035a5c2ae3 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -6,7 +6,7 @@ from decimal import Decimal from django import test from django import forms from django.core.exceptions import ValidationError -from django.db import models, IntegrityError +from django.db import connection, models, IntegrityError from django.db.models.fields.files import FieldFile from django.utils import six from django.utils import unittest @@ -455,6 +455,10 @@ 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) -- cgit v1.3