def setUp(self, key): # is there a better way? TestCase.mktemp() doesn't work otherwise self._testMethodName = key self.setUpMailStuff() p = self.createMIMEReceiver().feedStringNow( PartMaker('multipart/alternative', 'alt', PartMaker('text/plain', 'this is the text/plain'), PartMaker('text/html', 'this is the text/html')).make()) f = MessageBodyFragment(p.message, 'text/plain') f.setFragmentParent(self) return f