OpenSlides/tests/utils/test_forms.py
Oskar Hahn 4f27b9b63d Fix LocalizedModelMultipleChoiceField
It has to be a generator, so it does not call the queryset
2015-01-16 20:47:43 +01:00

13 lines
424 B
Python

from types import GeneratorType
from unittest.mock import MagicMock
from openslides.utils.forms import LocalizedModelMultipleChoiceField
from openslides.utils.test import TestCase
class TestLocalizedModelMultipleChoiceField(TestCase):
def test_localized_get_choices(self):
test_field = LocalizedModelMultipleChoiceField(queryset=MagicMock())
self.assertEqual(type(test_field.choices), GeneratorType)