Skip to content

Commit

Permalink
Add test to cover force_text fully
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jan 14, 2025
1 parent bb33a7c commit 7a576d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/messages/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@ def test_catalog_mime_headers_set_locale():
]


def test_catalog_mime_headers_type_coercion():
"""
Test that mime headers' keys and values are coerced to strings
"""
cat = catalog.Catalog(locale='de_DE', project='Foobar', version='1.0')
# This is a strange interface in that it doesn't actually overwrite all
# of the MIME headers, but just sets the ones that are passed in (and known).
cat.mime_headers = {b'REPORT-MSGID-BUGS-TO': 8}.items()
assert dict(cat.mime_headers)['Report-Msgid-Bugs-To'] == '8'


def test_catalog_num_plurals():
assert catalog.Catalog(locale='en').num_plurals == 2
assert catalog.Catalog(locale='ga').num_plurals == 5
Expand Down

0 comments on commit 7a576d2

Please sign in to comment.