Skip to content

Commit 7a576d2

Browse files
committed
Add test to cover force_text fully
1 parent bb33a7c commit 7a576d2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/messages/test_catalog.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,17 @@ def test_catalog_mime_headers_set_locale():
414414
]
415415

416416

417+
def test_catalog_mime_headers_type_coercion():
418+
"""
419+
Test that mime headers' keys and values are coerced to strings
420+
"""
421+
cat = catalog.Catalog(locale='de_DE', project='Foobar', version='1.0')
422+
# This is a strange interface in that it doesn't actually overwrite all
423+
# of the MIME headers, but just sets the ones that are passed in (and known).
424+
cat.mime_headers = {b'REPORT-MSGID-BUGS-TO': 8}.items()
425+
assert dict(cat.mime_headers)['Report-Msgid-Bugs-To'] == '8'
426+
427+
417428
def test_catalog_num_plurals():
418429
assert catalog.Catalog(locale='en').num_plurals == 2
419430
assert catalog.Catalog(locale='ga').num_plurals == 5

0 commit comments

Comments
 (0)