From 9879d7dc4ed8dbfa80a9d4efb955df6ffef34879 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Thu, 11 Jan 2018 09:23:05 +0000
Subject: [PATCH] Add tests to cover the changing of the field type

---
 opentech/apply/categories/tests/test_blocks.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/opentech/apply/categories/tests/test_blocks.py b/opentech/apply/categories/tests/test_blocks.py
index 0e8db5613..17ab027e7 100644
--- a/opentech/apply/categories/tests/test_blocks.py
+++ b/opentech/apply/categories/tests/test_blocks.py
@@ -1,3 +1,4 @@
+from django import forms
 from django.test import TestCase
 
 from opentech.apply.categories.blocks import CategoryQuestionBlock
@@ -34,3 +35,11 @@ class TestCategoryQuestionBlock(TestCase):
         field = self.get_field(**values)
         self.assertEqual(values['field_label'], field.label)
         self.assertEqual(values['help_text'], field.help_text)
+
+    def test_multi_select_enabled(self):
+        field = self.get_field(multi=True)
+        self.assertTrue(isinstance(field, forms.MultipleChoiceField))
+
+    def test_multi_select_disabled(self):
+        field = self.get_field(multi=True)
+        self.assertTrue(isinstance(field, forms.ChoiceField))
-- 
GitLab