1
# Copyright 2014 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Tests for forms helpers."""
6
from __future__ import (
18
from maasserver.testing.factory import factory
19
from maasserver.utils.forms import compose_invalid_choice_text
20
from maastesting.testcase import MAASTestCase
21
from testtools.matchers import ContainsAll
24
class TestComposeInvalidChoiceText(MAASTestCase):
26
def test_map_enum_includes_all_enum_values(self):
28
(factory.make_name('value'), factory.make_name('key'))
30
msg = compose_invalid_choice_text(factory.make_name(), choices)
33
ContainsAll(["'%s'" % key for key, val in choices]))