Description: Patch to fix t_describe from upstream
Author: Sébastien Renard <Sebastien.Renard@digitalfox.org>
Bug-Debian: http://bugs.debian.org/632593
Last-Update: 2011-07-05

--- yokadi-0.13.0.orig/src/yokadi/tui.py
+++ yokadi-0.13.0/src/yokadi/tui.py
@@ -44,6 +44,8 @@ def editText(text):
     """Edit text with external editor
     @return: newText"""
     (fd, name) = tempfile.mkstemp(suffix=".txt", prefix="yokadi-")
+    if text is None:
+        text = ""
     try:
         fl = file(name, "w")
         fl.write(text.encode(ENCODING, "replace"))
--- /dev/null
+++ yokadi-0.13.0/src/yokadi/tests/tuitestcase.py
@@ -0,0 +1,17 @@
+# -*- coding: UTF-8 -*-
+"""
+TUI module test cases
+@author: Aurélien Gâteau <aurelien.gateau@free.fr>
+@license: GPL v3 or later
+"""
+
+import os
+import unittest
+
+import tui
+
+class TuiTestCase(unittest.TestCase):
+    def testEditEmptyText(self):
+        os.environ["EDITOR"] = "/bin/true"
+        out = tui.editText(None)
+        self.assertEqual(out, "")
--- yokadi-0.13.0.orig/src/yokadi/tests/tests.py
+++ yokadi-0.13.0/src/yokadi/tests/tests.py
@@ -28,7 +28,7 @@ from textlistrenderertestcase import Tex
 from icaltestcase import IcalTestCase
 from keywordtestcase import KeywordTestCase
 from cryptotestcase import CryptoTestCase
-
+from tuitestcase import TuiTestCase
 
 def main():
     db.connectDatabase("", memoryDatabase=True)
