diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-05-12 14:57:58 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-05-12 14:57:58 -0500 |
commit | 8b28bee4c1de6f1190091f5c17c0cf0f948c7071 (patch) | |
tree | 4401c465a44521717446081ed147dc3c21b02c0a /mediagoblin/tests/test_util.py | |
parent | 2de317f2f35cfceffdda2c3990ad32b661161fb8 (diff) | |
download | mediagoblin-8b28bee4c1de6f1190091f5c17c0cf0f948c7071.tar.lz mediagoblin-8b28bee4c1de6f1190091f5c17c0cf0f948c7071.tar.xz mediagoblin-8b28bee4c1de6f1190091f5c17c0cf0f948c7071.zip |
Added some locale determination tools
Diffstat (limited to 'mediagoblin/tests/test_util.py')
-rw-r--r-- | mediagoblin/tests/test_util.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_util.py b/mediagoblin/tests/test_util.py index 5bc31fd6..ff40a677 100644 --- a/mediagoblin/tests/test_util.py +++ b/mediagoblin/tests/test_util.py @@ -69,3 +69,29 @@ I hope you like unit tests JUST AS MUCH AS I DO!""" assert mbox_message.get_payload(decode=True) == """HAYYY GUYS! I hope you like unit tests JUST AS MUCH AS I DO!""" + + +def test_locale_to_lower_upper(): + """ + Test cc.i18n.util.locale_to_lower_upper() + """ + assert util.locale_to_lower_upper('en') == 'en' + assert util.locale_to_lower_upper('en_US') == 'en_US' + assert util.locale_to_lower_upper('en-us') == 'en_US' + + # crazy renditions. Useful? + assert util.locale_to_lower_upper('en-US') == 'en_US' + assert util.locale_to_lower_upper('en_us') == 'en_US' + + +def test_locale_to_lower_lower(): + """ + Test cc.i18n.util.locale_to_lower_lower() + """ + assert util.locale_to_lower_lower('en') == 'en' + assert util.locale_to_lower_lower('en_US') == 'en-us' + assert util.locale_to_lower_lower('en-us') == 'en-us' + + # crazy renditions. Useful? + assert util.locale_to_lower_lower('en-US') == 'en-us' + assert util.locale_to_lower_lower('en_us') == 'en-us' |