def test_linked_references(self): from clld.web.util.helpers import linked_references with patch('clld.web.util.helpers.link'): linked_references( self.env['request'], Mock( references=[MagicMock(description=''), MagicMock(description='')]))
def test_linked_references(self): from clld.web.util.helpers import linked_references with patch("clld.web.util.helpers.link"): linked_references( self.env["request"], Mock(references=[MagicMock(description=""), MagicMock(description="")]) )
def test_linked_references(env, mocker): from clld.web.util.helpers import linked_references assert linked_references(env['request'], None) == '' mocker.patch('clld.web.util.helpers.link') linked_references( env['request'], mocker.Mock(references=[ mocker.MagicMock(description=''), mocker.MagicMock(description='')]))
def test_linked_references(self): from clld.web.util.helpers import linked_references with patch('clld.web.util.helpers.link'): linked_references( self.env['request'], Mock(references=[ MagicMock(description=''), MagicMock(description='') ]))
def format(self, item): vs = self.get_obj(item) return ', '.join( nfilter([ getattr(vs, 'source', None), linked_references(self.dt.req, vs) ]))
def format(self, item): lis = [] if item.source: s = item.source if s.startswith('http://'): label = s for t in 'wikimedia wikipedia plantzafrica'.split(): if t in s: label = t break lis.append(external_link(s, label)) lis.append(linked_references(self.dt.req, item)) return HTML.ul(*lis, class_='unstyled')
def format(self, item): return linked_references(self.dt.req, item)
def format(self, item): return linked_references(self.dt.req, item.valueset)
def format(self, item): return ', '.join(filter( None, [item.valueset.source, linked_references(self.dt.req, item.valueset)]))
def format(self, item): return ', '.join( filter(None, [ item.valueset.source, linked_references(self.dt.req, item.valueset) ]))
def format(self, item): vs = self.get_obj(item) return ', '.join( nfilter([getattr(vs, 'source', None), linked_references(self.dt.req, vs)]))
def format(self, item): return HTML.small(linked_references(self.dt.req, item.valueset))
def format(self, item): vs = self.get_obj(item) return linked_references(self.dt.req, vs)