diff options
| author | Cameron Curry <cameroncurry@users.noreply.github.com> | 2017-12-18 21:19:57 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-12-22 16:31:46 -0500 |
| commit | 622ead6aaf55288cd355f22e8bb9c56d8e12556c (patch) | |
| tree | 8cf0611e087d7b97b6786a97d9758f4065d8c8fa /tests | |
| parent | 9f7772e098439f9edea3d25ab127539fc514eeb2 (diff) | |
Fixed #28937 -- Allowed BinaryField to be editable=True.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/field_deconstruction/tests.py | 4 | ||||
| -rw-r--r-- | tests/model_fields/test_binaryfield.py | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/field_deconstruction/tests.py b/tests/field_deconstruction/tests.py index f1652e2c40..2cf1f93e22 100644 --- a/tests/field_deconstruction/tests.py +++ b/tests/field_deconstruction/tests.py @@ -514,3 +514,7 @@ class FieldDeconstructionTests(SimpleTestCase): self.assertEqual(path, "django.db.models.BinaryField") self.assertEqual(args, []) self.assertEqual(kwargs, {}) + field = models.BinaryField(editable=True) + name, path, args, kwargs = field.deconstruct() + self.assertEqual(args, []) + self.assertEqual(kwargs, {'editable': True}) diff --git a/tests/model_fields/test_binaryfield.py b/tests/model_fields/test_binaryfield.py index 9d97d1118f..ee40ed48fb 100644 --- a/tests/model_fields/test_binaryfield.py +++ b/tests/model_fields/test_binaryfield.py @@ -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) |
