@ -13,18 +13,13 @@ class TestReportQWebParameter(common.TransactionCase):
report_name = ' report_qweb_parameter.test_report_length '
report_name = ' report_qweb_parameter.test_report_length '
report_obj = self . env [ ' ir.actions.report ' ]
report_obj = self . env [ ' ir.actions.report ' ]
report_object = report_obj . _get_report_from_name ( report_name )
report_object = report_obj . _get_report_from_name ( report_name )
docs = self . env [ ' res.company ' ] . search ( [ ] , limit = 1 )
vat = docs . vat
website = docs . website
street = docs . street
company_registry = docs . company_registry
docs . update ( {
docs = self . env [ ' res.company ' ] . create ( {
' name ' : ' Test company ' ,
' street ' : ' 12345678901 ' ,
' street ' : ' 12345678901 ' ,
' vat ' : ' 12345678901 ' ,
' vat ' : ' 12345678901 ' ,
' website ' : ' 1234567890 ' ,
' company_registry ' : ' 1234567890 '
' company_registry ' : ' 1234567890 '
} )
} )
docs . website = ' 1234567890 ' # for avoding that Odoo adds http://
rep = report_object . render ( docs . ids , False )
rep = report_object . render ( docs . ids , False )
root = ET . fromstring ( rep [ 0 ] )
root = ET . fromstring ( rep [ 0 ] )
self . assertEqual ( root [ 0 ] . text , " 1234567890 " )
self . assertEqual ( root [ 0 ] . text , " 1234567890 " )
@ -42,9 +37,3 @@ class TestReportQWebParameter(common.TransactionCase):
{ ' website ' : ' 1234567890 ' , ' company_registry ' : ' 12345678901 ' } )
{ ' website ' : ' 1234567890 ' , ' company_registry ' : ' 12345678901 ' } )
with self . assertRaises ( QWebException ) :
with self . assertRaises ( QWebException ) :
report_object . render ( docs . ids , False )
report_object . render ( docs . ids , False )
docs . update ( {
' street ' : street ,
' vat ' : vat ,
' website ' : website ,
' company_registry ' : company_registry
} )