Skip to content

Commit

Permalink
fix:standardize_lang
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Oct 16, 2024
1 parent 544ed52 commit c2da772
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/unittests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ def test_no_lang_in_message(self):
"""No lang in message should result in lang from active locale."""
setup_locale("it-it")
msg = Message('test msg', data={})
self.assertEqual(get_message_lang(msg), 'it-it')
self.assertEqual(get_message_lang(msg), 'it-IT')
setup_locale("en-us")
self.assertEqual(get_message_lang(msg), 'en-us')
self.assertEqual(get_message_lang(msg), 'en-US')

def test_lang_exists(self):
"""Message has a lang code in data, it should be used."""
msg = Message('test msg', data={'lang': 'de-de'})
self.assertEqual(get_message_lang(msg), 'de-de')
msg = Message('test msg', data={'lang': 'sv-se'})
self.assertEqual(get_message_lang(msg), 'sv-se')
self.assertEqual(get_message_lang(msg), 'de-DE')
msg = Message('test msg', data={'lang': 'sv-SE'})
self.assertEqual(get_message_lang(msg), 'sv-SE')


class TestCollectionMessage(unittest.TestCase):
Expand Down

0 comments on commit c2da772

Please sign in to comment.