def test_set_content_validation_name(self): cell = Cell() cell.content_validation_name = 'validation' self.assertEqual(cell.content_validation_name, 'validation') self.assertEqual(cell.get_attr(CN('table:content-validation-name')), 'validation', 'wrong tag name')
def test_cover_cell_and_remove_unwanted_tags(self): cell = Cell() cell._set_span((2, 2)) cell._set_covered(True) self.assertIsNone(cell.get_attr(CN('table:number-rows-spanned'))) self.assertIsNone(cell.get_attr(CN('table:number-colums-spanned')))
def test_set_style_name(self): cell = Cell() cell.style_name = 'STYLE' self.assertEqual(cell.style_name, 'STYLE') self.assertEqual(cell.get_attr(CN('table:style-name')), 'STYLE', 'wrong tag name')
def test_set_formula(self): cell = Cell() cell.formula = "=[.A1]" self.assertEqual(cell.formula, "=[.A1]") self.assertEqual(cell.get_attr(CN('table:formula')), "=[.A1]", 'wrong tag name')
def test_set_value_type(self): cell = Cell() cell.set_value('a string') self.assertEqual(cell.value_type, 'string') self.assertEqual(cell.get_attr(CN('office:value-type')), 'string', 'wrong tag name')