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

Fixed #28937 -- Allowed BinaryField to be editable=True.

This commit is contained in:
Cameron Curry
2017-12-18 21:19:57 +01:00
committed by Tim Graham
parent 9f7772e098
commit 622ead6aaf
7 changed files with 35 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
from .models import DataModel
@@ -25,3 +26,11 @@ class BinaryFieldTests(TestCase):
dm = DataModel(short_data=self.binary_data * 4)
with self.assertRaises(ValidationError):
dm.full_clean()
def test_editable(self):
field = models.BinaryField()
self.assertIs(field.editable, False)
field = models.BinaryField(editable=True)
self.assertIs(field.editable, True)
field = models.BinaryField(editable=False)
self.assertIs(field.editable, False)