@pytest.mark.parametrize('specialchars', [' ', ' abcde ', ' ab cd', ' abcde', 'abcde ', ' a b c d e ', ' a b c d e '])
@pytest.mark.django_db
def test_clean_specialchars_whitespace(specialchars):
 form_data = {'code': 'foo', 'fullname': 'Foo', 'checkstyle': 'foo', 'nplurals': '2', 'specialchars': specialchars}
 form = LanguageForm(form_data)
 assert form.is_valid()
 assert (' ' in form.cleaned_data['specialchars'])

@ pytest . mark . parametrize ( 'specialchars' , [ ' ' , ' abcde ' , ' ab cd' , ' abcde' , 'abcde ' , ' a b c d e ' , ' a b c d e ' ] ) @ pytest . mark . django_db def test_clean_specialchars_whitespace ( specialchars ) : form_data = { 'code' : 'foo' , 'fullname' : 'Foo' , 'checkstyle' : 'foo' , 'nplurals' : '2' , 'specialchars' : specialchars } form = LanguageForm ( form_data ) assert form . is_valid ( ) assert ( ' ' in form . cleaned_data [ 'specialchars' ] )
tests whitespace is accepted in special characters .