def test_with_user_field(self):
     user_field_decl = odf_create_user_field_decl(u'你好 Zoé', 42)
     set_value(user_field_decl, u'你好 Zoé')
     expected = (('<text:user-field-decl office:value-type="string" '
                    'office:string-value="%s" text:name="%s"/>') %
                         ((convert_unicode(u'你好 Zoé'),) * 2))
     self.assertEqual(user_field_decl.serialize(), expected)
Exemple #2
0
 def test_with_user_field(self):
     user_field_decl = odf_create_user_field_decl('你好 Zoé', 42)
     set_value(user_field_decl, '你好 Zoé')
     expected = (('<text:user-field-decl office:value-type="string" '
                    'office:string-value="%s" text:name="%s"/>') %
                         ((convert_unicode('你好 Zoé'),) * 2))
     self.assertEqual(user_field_decl.serialize(), expected)
 def test_with_variable(self):
     variable_set = odf_create_variable_set(u'你好 Zoé', 42)
     set_value(variable_set, u'你好 Zoé')
     expected = ('<text:variable-set office:value-type="string" '
                   'office:string-value="%s" text:name="%s" '
                   'text:display="none">'
                   '%s'
                 '</text:variable-set>') % (
                         (convert_unicode(u'你好 Zoé'),) * 3)
     self.assertEqual(variable_set.serialize(), expected)
Exemple #4
0
 def test_with_variable(self):
     variable_set = odf_create_variable_set('你好 Zoé', 42)
     set_value(variable_set, '你好 Zoé')
     expected = ('<text:variable-set office:value-type="string" '
                   'office:string-value="%s" text:name="%s" '
                   'text:display="none">'
                   '%s'
                 '</text:variable-set>') % (
                         (convert_unicode('你好 Zoé'),) * 3)
     self.assertEqual(variable_set.serialize(), expected)
 def test_with_cell(self):
     cell = odf_create_cell(42)
     set_value(cell, u'你好 Zoé')
     expected = ('<table:table-cell office:value-type="string" '
                   'office:string-value="%s">'
                   '<text:p>'
                     '%s'
                   '</text:p>'
                 '</table:table-cell>') % (
                             (convert_unicode(u'你好 Zoé'),) * 2)
     self.assertEqual(cell.serialize(), expected)
Exemple #6
0
 def test_with_cell(self):
     cell = odf_create_cell(42)
     set_value(cell, '你好 Zoé')
     expected = ('<table:table-cell office:value-type="string" '
                   'office:string-value="%s">'
                   '<text:p>'
                     '%s'
                   '</text:p>'
                 '</table:table-cell>') % (
                             (convert_unicode('你好 Zoé'),) * 2)
     self.assertEqual(cell.serialize(), expected)