def test_make_html_links(self): test = [('url1', 'name1'), ('url2', 'name2')] links = utils.make_html_links(test) self.assertEqual(len(links.split(' | ')), 2) self.assertIn('url1', links) self.assertIn('name1', links) self.assertIn('url2', links) self.assertIn('name2', links)
def test_make_html_links(self): test = [('url1', 'name1'), ('url2', 'name2'), ('url3', 'name3', 'POST')] links = utils.make_html_links(test) self.assertEqual(len(links.split(' | ')), 3) self.assertIn('url1', links) self.assertIn('name1', links) self.assertIn('url2', links) self.assertIn('name2', links) self.assertIn('href="#"', links) self.assertIn('data-post-url="url3"', links) self.assertIn('name3', links)
def actions_field(self, instance): return make_html_links(self.inline_actions(instance))
def inner(instance): inline_actions = self.inline_actions(instance, contest) return make_html_links(inline_actions)