@pytest.mark.parametrize('specialchars, count_char', [(' abcde     ', ' '), (' aaaaaaaaaa', 'a'), ('\xc4\x81\xc3\xa9\xc4\xa9\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xbc', u'\xf8')])
@pytest.mark.django_db
def test_clean_specialchars_unique(specialchars, count_char):
 form_data = {'code': 'foo', 'fullname': 'Foo', 'checkstyle': 'foo', 'nplurals': '2', 'specialchars': specialchars}
 form = LanguageForm(form_data)
 assert form.is_valid()
 assert (form.cleaned_data['specialchars'].count(count_char) == 1)

@ pytest . mark . parametrize ( 'specialchars, count_char' , [ ( ' abcde     ' , ' ' ) , ( ' aaaaaaaaaa' , 'a' ) , ( '\xc4\x81\xc3\xa9\xc4\xa9\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xb8\xc3\xbc' , u'\xf8' ) ] ) @ pytest . mark . django_db def test_clean_specialchars_unique ( specialchars , count_char ) : form_data = { 'code' : 'foo' , 'fullname' : 'Foo' , 'checkstyle' : 'foo' , 'nplurals' : '2' , 'specialchars' : specialchars } form = LanguageForm ( form_data ) assert form . is_valid ( ) assert ( form . cleaned_data [ 'specialchars' ] . count ( count_char ) == 1 )
tests special characters are unique .