#NEWLINE# def test_locale_html( ) : #NEWLINE# #INDENT# 'Test HTML attributes for languages different than the site language' #NEWLINE# testfield = Mock ( ) #NEWLINE# this_lang = translation . get_language ( ) #NEWLINE# testfield . locale = this_lang #NEWLINE# s = helpers . locale_html ( testfield ) #NEWLINE# assert ( not s ) , 'no special HTML attributes for site language' #NEWLINE# testfield . locale = 'de' #NEWLINE# s = helpers . locale_html ( s ) #NEWLINE# eq_ ( s , ' lang="de" dir="ltr"' ) #NEWLINE# for lang in settings . RTL_LANGUAGES : #NEWLINE# #INDENT# testfield . locale = lang #NEWLINE# s = helpers . locale_html ( testfield ) #NEWLINE# eq_ ( s , ( ' lang="%s" dir="rtl"' % testfield . locale ) )