def test_multistringwidget_decompress_multistrings(value): """Tests unit's `MultiStringWidget` decompresses string values.""" widget = MultiStringWidget() expected_value = [value] if isinstance(value, str) else value assert widget.decompress(multistring.multistring(value)) == expected_value
def test_multistringwidget_decompress_list_of_values(value): """Tests unit's `MultiStringWidget` decompresses a list of values.""" widget = MultiStringWidget() assert widget.decompress(value) == value
def test_multistringwidget_decompress_strings(value): """Tests unit's `MultiStringWidget` decompresses string values.""" widget = MultiStringWidget() assert widget.decompress(value) == [value]
def test_multistringwidget_decompress_none(nplurals, decompressed_value): """Tests unit's `MultiStringWidget` decompresses None values.""" widget = MultiStringWidget(nplurals=nplurals) assert widget.decompress(None) == decompressed_value
def test_multistringwidget_decompress_multistrings(value): """Tests unit's `MultiStringWidget` decompresses string values.""" widget = MultiStringWidget() expected_value = [value] if isinstance(value, basestring) else value assert widget.decompress(multistring.multistring(value)) == expected_value