@@ -1230,19 +1230,14 @@ class LangStringSetTest(unittest.TestCase):
12301230 def test_language_tag_constraints (self ) -> None :
12311231 with self .assertRaises (ValueError ) as cm :
12321232 model .LangStringSet ({"foo" : "bar" })
1233- self .assertEqual ("The language code 'foo' of the language tag 'foo' doesn't consist of exactly "
1234- "two lower-case letters!" , str (cm .exception ))
1235- with self .assertRaises (ValueError ) as cm :
1236- model .LangStringSet ({"fo-OO-bar" : "bar" })
1237- self .assertEqual ("The extension 'OO-bar' of the language tag 'fo-OO-bar' doesn't consist of exactly "
1238- "two upper-case letters!" , str (cm .exception ))
1239- model .LangStringSet ({"fo" : "bar" })
1233+ self .assertEqual ("The language code of the language tag must consist of exactly two lower-case letters! "
1234+ "Given language tag and language code: 'foo', 'foo'" , str (cm .exception ))
12401235
12411236 lss = model .LangStringSet ({"fo-OO" : "bar" })
12421237 with self .assertRaises (ValueError ) as cm :
12431238 lss ["foo" ] = "bar"
1244- self .assertEqual ("The language code 'foo' of the language tag 'foo' doesn't consist of exactly "
1245- "two lower-case letters! " , str (cm .exception ))
1239+ self .assertEqual ("The language code of the language tag must consist of exactly two lower-case letters! "
1240+ "Given language tag and language code: 'foo', 'foo' " , str (cm .exception ))
12461241 self .assertNotIn ("foo" , lss )
12471242 self .assertNotIn ("fo" , lss )
12481243 lss ["fo" ] = "bar"
0 commit comments