def test_default_region_tag(self): w = DFXPWriter() result = w.write(self.captions) default_region = w._recreate_style(DFXP_DEFAULT_REGION, None) default_region[u'xml:id'] = DFXP_DEFAULT_REGION_ID soup = BeautifulSoup(result, u'xml') region = soup.find(u'region', {u'xml:id': DFXP_DEFAULT_REGION_ID}) self.assertTrue(region) self.assertEquals(region.attrs, default_region)
def test_default_styling_tag(self): w = DFXPWriter() result = w.write(self.captions_without_style_and_region) default_style = w._recreate_style(DFXP_DEFAULT_STYLE, None) default_style[u'xml:id'] = DFXP_DEFAULT_STYLE_ID soup = BeautifulSoup(result, u'xml') style = soup.find(u'style', {u'xml:id': DFXP_DEFAULT_STYLE_ID}) self.assertTrue(style) self.assertEquals(style.attrs, default_style)