Commit a1c54608 authored by Ivan Tyagov's avatar Ivan Tyagov

It should be Ok to bring back validation with libre office 3.4.5

parent 325676db
...@@ -113,7 +113,6 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -113,7 +113,6 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
return style_dict return style_dict
# see comment at top # see comment at top
@expectedFailure
def test_01_TextField(self): def test_01_TextField(self):
""" """
mapping a field to textbox mapping a field to textbox
...@@ -163,7 +162,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -163,7 +162,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
'application/vnd.oasis.opendocument.graphics') 'application/vnd.oasis.opendocument.graphics')
self.assertEqual(request.RESPONSE.getHeader('content-disposition'), self.assertEqual(request.RESPONSE.getHeader('content-disposition'),
'inline;filename="Foo_viewAsODGPrintout.odg"') 'inline;filename="Foo_viewAsODGPrintout.odg"')
#self._validate(odf_document) self._validate(odf_document)
# 2. Normal case: change the field value and check again the ODF document # 2. Normal case: change the field value and check again the ODF document
test1.setTitle("Changed Title!") test1.setTitle("Changed Title!")
...@@ -173,7 +172,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -173,7 +172,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertTrue(content_xml.find("Changed Title!") > 0) self.assertTrue(content_xml.find("Changed Title!") > 0)
#self._validate(odf_document) self._validate(odf_document)
# 3. False case: change the field name # 3. False case: change the field name
test1.setTitle("you cannot find") test1.setTitle("you cannot find")
...@@ -185,7 +184,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -185,7 +184,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertFalse(content_xml.find("you cannot find") > 0) self.assertFalse(content_xml.find("you cannot find") > 0)
#self._validate(odf_document) self._validate(odf_document)
# put back # put back
foo_form.manage_renameObject('xxx_title', 'my_title', REQUEST=request) foo_form.manage_renameObject('xxx_title', 'my_title', REQUEST=request)
...@@ -208,7 +207,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -208,7 +207,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self.assertTrue(content_xml.find("call!") > 0) self.assertTrue(content_xml.find("call!") > 0)
# when just call FormPrintout, it does not change content-type # when just call FormPrintout, it does not change content-type
self.assertEqual(request.RESPONSE.getHeader('content-type'), 'text/html') self.assertEqual(request.RESPONSE.getHeader('content-type'), 'text/html')
#self._validate(odf_document) self._validate(odf_document)
# 5. Normal case: utf-8 string # 5. Normal case: utf-8 string
test1.setTitle("Français") test1.setTitle("Français")
...@@ -217,7 +216,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -217,7 +216,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertTrue(content_xml.find("Français") > 0) self.assertTrue(content_xml.find("Français") > 0)
#self._validate(odf_document) self._validate(odf_document)
# 6. Normal case: unicode string # 6. Normal case: unicode string
test1.setTitle(u'Français test2') test1.setTitle(u'Français test2')
...@@ -272,7 +271,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -272,7 +271,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
odf_document = foo_printout.index_html(request) odf_document = foo_printout.index_html(request)
self.assertTrue(odf_document is not None) self.assertTrue(odf_document is not None)
# validate the generated document # validate the generated document
#self._validate(odf_document) self._validate(odf_document)
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
content = etree.XML(content_xml) content = etree.XML(content_xml)
...@@ -324,7 +323,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -324,7 +323,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
# 01 - Normal image mapping # 01 - Normal image mapping
odf_document = foo_printout(request) odf_document = foo_printout(request)
self.assertTrue(odf_document is not None) self.assertTrue(odf_document is not None)
#self._validate(odf_document) self._validate(odf_document)
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertTrue(content_xml.find("Pictures/0.png") > 0) self.assertTrue(content_xml.find("Pictures/0.png") > 0)
...@@ -358,7 +357,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -358,7 +357,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
# confirming the image was removed # confirming the image was removed
self.assertFalse(content_xml.find("Pictures/0.png") > 0) self.assertFalse(content_xml.find("Pictures/0.png") > 0)
#self._validate(odf_document) self._validate(odf_document)
def test_04_ProxyField(self): def test_04_ProxyField(self):
""" """
...@@ -409,7 +408,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -409,7 +408,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
'application/vnd.oasis.opendocument.graphics') 'application/vnd.oasis.opendocument.graphics')
self.assertEqual(request.RESPONSE.getHeader('content-disposition'), self.assertEqual(request.RESPONSE.getHeader('content-disposition'),
'inline;filename="Foo_viewProxyFieldAsODGPrintout.odg"') 'inline;filename="Foo_viewProxyFieldAsODGPrintout.odg"')
#self._validate(odf_document) self._validate(odf_document)
# 2. Normal case: change the field value and check again the ODF document # 2. Normal case: change the field value and check again the ODF document
test1.setTitle("Changed Title!") test1.setTitle("Changed Title!")
...@@ -419,7 +418,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -419,7 +418,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertTrue(content_xml.find("Changed Title!") > 0) self.assertTrue(content_xml.find("Changed Title!") > 0)
#self._validate(odf_document) self._validate(odf_document)
# 3. False case: change the field name # 3. False case: change the field name
test1.setTitle("you cannot find") test1.setTitle("you cannot find")
...@@ -431,7 +430,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -431,7 +430,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertFalse(content_xml.find("you cannot find") > 0) self.assertFalse(content_xml.find("you cannot find") > 0)
#self._validate(odf_document) self._validate(odf_document)
# put back # put back
foo_form.manage_renameObject('xxx_title', 'my_title', REQUEST=request) foo_form.manage_renameObject('xxx_title', 'my_title', REQUEST=request)
...@@ -453,7 +452,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -453,7 +452,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
self.assertTrue(content_xml.find("call!") > 0) self.assertTrue(content_xml.find("call!") > 0)
self.assertEqual(request.RESPONSE.getHeader('content-type'), self.assertEqual(request.RESPONSE.getHeader('content-type'),
'application/vnd.oasis.opendocument.graphics') 'application/vnd.oasis.opendocument.graphics')
#self._validate(odf_document) self._validate(odf_document)
# 5. Normal case: utf-8 string # 5. Normal case: utf-8 string
test1.setTitle("Français") test1.setTitle("Français")
...@@ -462,7 +461,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -462,7 +461,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertTrue(content_xml.find("Français") > 0) self.assertTrue(content_xml.find("Français") > 0)
#self._validate(odf_document) self._validate(odf_document)
# 6. Normal case: unicode string # 6. Normal case: unicode string
test1.setTitle(u'Français test2') test1.setTitle(u'Français test2')
...@@ -471,7 +470,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -471,7 +470,7 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
builder = OOoBuilder(odf_document) builder = OOoBuilder(odf_document)
content_xml = builder.extract("content.xml") content_xml = builder.extract("content.xml")
self.assertTrue(content_xml.find("Français test2") > 0) self.assertTrue(content_xml.find("Français test2") > 0)
#self._validate(odf_document) self._validate(odf_document)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment