Add unit tests for write_message
Merge pull request #592 from mozilla-services/write_message_tests

Add unit tests for write_message