1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #14567 -- Fixed failing test that wasn't being run.

This commit is contained in:
Carl Meyer 2013-04-16 13:34:06 -06:00
parent 58b3a974fc
commit a98465c040
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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))