From b4a56ed4f55502239cb11b57f0fa75baa0a97640 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 18 Mar 2015 08:23:46 -0400 Subject: [PATCH] Refs #24483 -- Added a test for deconstruction of Field.choices --- tests/field_deconstruction/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/field_deconstruction/tests.py b/tests/field_deconstruction/tests.py index fd827e4b72d..bbbbefa7e9f 100644 --- a/tests/field_deconstruction/tests.py +++ b/tests/field_deconstruction/tests.py @@ -69,6 +69,13 @@ class FieldDeconstructionTests(TestCase): self.assertEqual(args, []) self.assertEqual(kwargs, {"max_length": 65, "null": True, "blank": True}) + def test_char_field_choices(self): + field = models.CharField(max_length=1, choices=(("A", "One"), ("B", "Two"))) + name, path, args, kwargs = field.deconstruct() + self.assertEqual(path, "django.db.models.CharField") + self.assertEqual(args, []) + self.assertEqual(kwargs, {"choices": [("A", "One"), ("B", "Two")], "max_length": 1}) + def test_csi_field(self): field = models.CommaSeparatedIntegerField(max_length=100) name, path, args, kwargs = field.deconstruct()