diff options
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index f22ab30..fc637d2 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -317,3 +317,13 @@ def test_compatible_classes_in_global_and_localedata(filename): with open(filename, 'rb') as f: return Unpickler(f).load() + + +def test_issue_601_no_language_name_but_has_variant(): + # kw_GB has a variant for Finnish but no actual language name for Finnish, + # so `get_display_name()` previously crashed with a TypeError as it attempted + # to concatenate " (Finnish)" to None. + # Instead, it's better to return None altogether, as we can't reliably format + # part of a language name. + + assert Locale.parse('fi_FI').get_display_name('kw_GB') == None |