def test_format_copyright_annotation(self): cp = CopyrightAnnotation(name='Siemens', coords=(0, 100), text='text text', locale='locale', company='Siemens', year_start=1996) s = cp.get_cite() # '/copyright/Siemens/1996' self.assertGreater(s.find('copyright'), -1) self.assertGreater(s.find('Siemens'), -1) self.assertGreater(s.find('1996'), -1) cp.year_end = 2019 cp.locale = 'en' s = cp.get_cite() # '/en/copyright/Siemens/1996/2019' self.assertGreater(s.find('copyright'), -1) self.assertGreater(s.find('Siemens'), -1) self.assertGreater(s.find('1996'), -1) self.assertGreater(s.find('2019'), -1)
def test_copyright_annotation(self): ant = CopyrightAnnotation(coords=(2, 20), year_start=1998, year_end=2001) cite = ant.get_cite() self.assertEqual('/en/copyright/1998/2001', cite)