From a98465c040319b74b697bace11da5b13cc42427f Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Tue, 16 Apr 2013 13:34:06 -0600 Subject: [PATCH] Refs #14567 -- Fixed failing test that wasn't being run. --- tests/forms_tests/tests/__init__.py | 2 +- tests/forms_tests/tests/tests.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/forms_tests/tests/__init__.py b/tests/forms_tests/tests/__init__.py index 3fb537ef41..aea9418c05 100644 --- a/tests/forms_tests/tests/__init__.py +++ b/tests/forms_tests/tests/__init__.py @@ -12,7 +12,7 @@ from .test_input_formats import (LocalizedTimeTests, CustomTimeInputFormatsTests SimpleDateFormatTests, LocalizedDateTimeTests, CustomDateTimeInputFormatsTests, SimpleDateTimeFormatTests) from .test_media import FormsMediaTestCase, StaticFormsMediaTestCase -from .tests import (TestTicket12510, ModelFormCallableModelDefault, +from .tests import (TestTicket12510, TestTicket14567, ModelFormCallableModelDefault, FormsModelTestCase, RelatedModelFormTests) from .test_regressions import FormsRegressionsTestCase from .test_util import FormsUtilTestCase diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py index be75643b28..80e2cadcc3 100644 --- a/tests/forms_tests/tests/tests.py +++ b/tests/forms_tests/tests/tests.py @@ -46,7 +46,8 @@ class TestTicket14567(TestCase): """ def test_empty_queryset_return(self): "If a model's ManyToManyField has blank=True and is saved with no data, a queryset is returned." - form = OptionalMultiChoiceModelForm({'multi_choice_optional': '', 'multi_choice': ['1']}) + option = ChoiceOptionModel.objects.create(name='default') + form = OptionalMultiChoiceModelForm({'multi_choice_optional': '', 'multi_choice': [option.pk]}) self.assertTrue(form.is_valid()) # Check that the empty value is a QuerySet self.assertTrue(isinstance(form.cleaned_data['multi_choice_optional'], models.query.QuerySet))