def test_notprimaryfield(self): context = self.portal['document'] context.setLocation('''<p><a name="foobar"></a></p>''') context.setText('') view = ATAnchorView(context, self.app.REQUEST) self.assertEqual(view.listAnchorNames(), []) self.assertEqual(view.listAnchorNames('location'), ['foobar'])
def test_brokenxml(self): context = self.portal['document'] context.text = RichTextValue( '''<p><div></p>''', 'text/plain', 'text/html' ) view = ATAnchorView(context, self.app.REQUEST) self.assertEqual(view.listAnchorNames(), [])
def test_primaryfield(self): context = self.portal['document'] context.text = RichTextValue( '''<p><a name="foobar"></a></p>''', 'text/plain', 'text/html' ) view = ATAnchorView(context, self.app.REQUEST) self.assertEqual(view.listAnchorNames(), ['foobar'])
def test_brokenxml(self): context = self.portal['document'] context.setText('''<p><div></p>''') view = ATAnchorView(context, self.app.REQUEST) self.assertEqual(view.listAnchorNames(), [])
def test_primaryfield(self): context = self.portal['document'] context.text = RichTextValue('''<p><a name="foobar"></a></p>''', 'text/plain', 'text/html') view = ATAnchorView(context, self.app.REQUEST) self.assertEqual(view.listAnchorNames(), ['foobar'])
def test_brokenxml(self): context = self.portal['document'] context.text = RichTextValue('''<p><div></p>''', 'text/plain', 'text/html') view = ATAnchorView(context, self.app.REQUEST) self.assertEqual(view.listAnchorNames(), [])