summaryrefslogtreecommitdiff
path: root/src/mailman/tests/test_documentation.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-07-18 22:31:45 -0400
committerBarry Warsaw2009-07-18 22:31:45 -0400
commitd9ad19e86ff658a74870fb488cd74e5002b63bc3 (patch)
tree29a7e53c290a95d6280772d6aa52a8b160649596 /src/mailman/tests/test_documentation.py
parent422a6757e6aafbd12c220aa8dfdc33f8c377718c (diff)
downloadmailman-d9ad19e86ff658a74870fb488cd74e5002b63bc3.tar.gz
mailman-d9ad19e86ff658a74870fb488cd74e5002b63bc3.tar.zst
mailman-d9ad19e86ff658a74870fb488cd74e5002b63bc3.zip
Diffstat (limited to 'src/mailman/tests/test_documentation.py')
-rw-r--r--src/mailman/tests/test_documentation.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mailman/tests/test_documentation.py b/src/mailman/tests/test_documentation.py
index 48b71d72c..0409e737c 100644
--- a/src/mailman/tests/test_documentation.py
+++ b/src/mailman/tests/test_documentation.py
@@ -69,16 +69,19 @@ class chdir:
-def specialized_message_from_string(text):
+def specialized_message_from_string(unicode_text):
"""Parse text into a message object.
This is specialized in the sense that an instance of Mailman's own Message
object is returned, and this message object has an attribute
`original_size` which is the pre-calculated size in bytes of the message's
text representation.
+
+ Also, the text must be ASCII-only unicode.
"""
# This mimic what Switchboard.dequeue() does when parsing a message from
# text into a Message instance.
+ text = unicode_text.encode('ascii')
original_size = len(text)
message = message_from_string(text, Message)
message.original_size = original_size