Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit a98465c040319b74b697bace11da5b13cc42427f 1 parent 58b3a97
@carljm carljm authored
View
2  tests/forms_tests/tests/__init__.py
@@ -12,7 +12,7 @@
SimpleDateFormatTests, LocalizedDateTimeTests,
CustomDateTimeInputFormatsTests, SimpleDateTimeFormatTests)
from .test_media import FormsMediaTestCase, StaticFormsMediaTestCase
-from .tests import (TestTicket12510, ModelFormCallableModelDefault,
+from .tests import (TestTicket12510, TestTicket14567, ModelFormCallableModelDefault,
@jdunck Collaborator
jdunck added a note

Perhaps this would be a good place to use "from .tests import *"? What else aren't we running? :/

@carljm Owner
carljm added a note

@prestontimmons found this failing test in his (awesome!) work on the test-discovery branch. I think there may be a few other tests that the discovery branch is finding that our current runner doesn't, but this was the only one that was failing. In any case, I'm not too concerned about tracking them all down and adding imports for them in master, since in the discovery branch all these imports go away anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
FormsModelTestCase, RelatedModelFormTests)
from .test_regressions import FormsRegressionsTestCase
from .test_util import FormsUtilTestCase
View
3  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))
Please sign in to comment.
Something went wrong with that request. Please try again.