@pytest.mark.parametrize('value', ['foo\\bar', 'fo\xc3\xb6\r\nb\xc3\xa4r', 'fo\xc3\xb6\\r\\nb\xc3\xa4r', 'fo\xc3\xb6\r\n\\r\\nb\xc3\xa4r', 'nfo\xc3\xb6\nb\xc3\xa4r', 'nfo\xc3\xb6\\nb\xc3\xa4r', 'fo\xc3\xb6\n\\nb\xc3\xa4r', ['foo\\bar'], ['fo\xc3\xb6\r\nb\xc3\xa4r'], ['fo\xc3\xb6\\r\\nb\xc3\xa4r'], ['fo\xc3\xb6\r\n\\r\\nb\xc3\xa4r', 'b\xc3\xa4r\r\n\\r\\nb\xc3\xa4z'], ['nfo\xc3\xb6\nb\xc3\xa4r'], ['nfo\xc3\xb6\\nb\xc3\xa4r'], ['fo\xc3\xb6\n\\nb\xc3\xa4r', 'b\xc3\xa4r\n\\nb\xc3\xa4z']])
def test_multistringwidget_decompress_multistrings(value):
 widget = MultiStringWidget()
 expected_value = ([value] if isinstance(value, basestring) else value)
 assert (widget.decompress(multistring.multistring(value)) == expected_value)

@ pytest . mark . parametrize ( 'value' , [ 'foo\\bar' , 'fo\xc3\xb6\r\nb\xc3\xa4r' , 'fo\xc3\xb6\\r\\nb\xc3\xa4r' , 'fo\xc3\xb6\r\n\\r\\nb\xc3\xa4r' , 'nfo\xc3\xb6\nb\xc3\xa4r' , 'nfo\xc3\xb6\\nb\xc3\xa4r' , 'fo\xc3\xb6\n\\nb\xc3\xa4r' , [ 'foo\\bar' ] , [ 'fo\xc3\xb6\r\nb\xc3\xa4r' ] , [ 'fo\xc3\xb6\\r\\nb\xc3\xa4r' ] , [ 'fo\xc3\xb6\r\n\\r\\nb\xc3\xa4r' , 'b\xc3\xa4r\r\n\\r\\nb\xc3\xa4z' ] , [ 'nfo\xc3\xb6\nb\xc3\xa4r' ] , [ 'nfo\xc3\xb6\\nb\xc3\xa4r' ] , [ 'fo\xc3\xb6\n\\nb\xc3\xa4r' , 'b\xc3\xa4r\n\\nb\xc3\xa4z' ] ] ) def test_multistringwidget_decompress_multistrings ( value ) : widget = MultiStringWidget ( ) expected_value = ( [ value ] if isinstance ( value , basestring ) else value ) assert ( widget . decompress ( multistring . multistring ( value ) ) == expected_value )
tests units multistringwidget decompresses string values .