def test_to_text(self): test_list = TodoTxtList() # Empty list yields empty string: self.assertEqual('', str(test_list)) todo_text = "(A) Do one thing\n (B) Do another thing\n x One last thing" expected_output = "(A) Do one thing\n(B) Do another thing\nx One last thing" test_list.init_from_text(todo_text) self.assertEqual(expected_output, str(test_list))