[Erp5-report] r32072 nicolas - /erp5/trunk/products/ERP5OOo/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 28 18:07:18 CET 2010


Author: nicolas
Date: Thu Jan 28 18:07:17 2010
New Revision: 32072

URL: http://svn.erp5.org?rev=32072&view=rev
Log:
Really check that exception is raised.
reviewed by jerome

Modified:
    erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODG.py
    erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py

Modified: erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODG.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODG.py?rev=32072&r1=32071&r2=32072&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODG.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODG.py [utf8] Thu Jan 28 18:07:17 2010
@@ -193,12 +193,7 @@
     self.assertTrue(foo_printout.template == 'Foo_getODGStyleSheet')
     tmp_template = foo_printout.template
     foo_printout.template = None
-    # template == None, causes a ValueError
-    try:
-      foo_printout.index_html(request)
-    except ValueError, e:
-      # e -> 'Can not create a ODF Document without a odf_template'
-      self.assertTrue(True)
+    self.assertRaises(ValueError, foo_printout.index_html, request)
 
     # put back
     foo_printout.template = tmp_template
@@ -444,13 +439,7 @@
     self.assertTrue(foo_printout.template == 'Foo_getODGStyleSheet')
     tmp_template = foo_printout.template
     foo_printout.template = None
-    # template == None, causes a ValueError
-    try:
-      foo_printout.index_html(REQUEST=request)
-    except ValueError, e:
-      # e -> 'Can not create a ODF Document without a odf_template'
-      self.assertTrue(True)
-
+    self.assertRaises(ValueError, foo_printout.index_html, request)
     # put back
     foo_printout.template = tmp_template
 

Modified: erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py?rev=32072&r1=32071&r2=32072&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py [utf8] Thu Jan 28 18:07:17 2010
@@ -189,13 +189,7 @@
     self.assertTrue(foo_printout.template == 'Foo_getODTStyleSheet')
     tmp_template = foo_printout.template
     foo_printout.template = None
-    # template == None, causes a ValueError
-    try:
-      foo_printout.index_html(REQUEST=request)
-    except ValueError, e:
-      # e -> 'Can not create a ODF Document without a odf_template'
-      self.assertTrue(True)
-
+    self.assertRaises(ValueError, foo_printout.index_html, request)
     # put back
     foo_printout.template = tmp_template
 




More information about the Erp5-report mailing list