From 59b83db9f8630b0a8105b9f2bd6b35227444f3fe Mon Sep 17 00:00:00 2001 From: Drew Hubl Date: Fri, 23 Sep 2016 04:53:51 -0600 Subject: [PATCH] Add test to check flatchoices --- example/app/test_msf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/example/app/test_msf.py b/example/app/test_msf.py index 54e03bb..ca18852 100644 --- a/example/app/test_msf.py +++ b/example/app/test_msf.py @@ -23,7 +23,7 @@ from django.test import TestCase from multiselectfield.utils import get_max_length -from .models import Book +from .models import Book, PROVINCES, STATES if sys.version_info < (3,): @@ -127,6 +127,11 @@ class MultiSelectTestCase(TestCase): self.assertEqual(get_field(Book, 'tags').value_to_string(book), 'sex,work,happy') self.assertEqual(get_field(Book, 'categories').value_to_string(book), '1,3,5') + def test_flatchoices(self): + #raise Exception(Book._meta.get_field('published_in').flatchoices) + # raise Exception(Book.published_in.flatchoices) + self.assertEqual(get_field(Book, 'published_in').flatchoices, list(PROVINCES+STATES)) + class MultiSelectUtilsTestCase(TestCase): def test_get_max_length_max_length_is_not_none(self):