We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
force_text
1 parent bb33a7c commit 7a576d2Copy full SHA for 7a576d2
1 file changed
tests/messages/test_catalog.py
@@ -414,6 +414,17 @@ def test_catalog_mime_headers_set_locale():
414
]
415
416
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
428
def test_catalog_num_plurals():
429
assert catalog.Catalog(locale='en').num_plurals == 2
430
assert catalog.Catalog(locale='ga').num_plurals == 5
0 commit comments