Commit 748761d7 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

chore: make flake8 happy

parent 8667c9ffe8fc
......@@ -146,9 +146,9 @@ class Concept(AnyEntity):
def labels(self):
"""Dict of preferred labels by (short) language-code."""
labels = {}
for l in self.preferred_label:
labels[l.short_language_code] = l.label
labels[l.language_code] = l.label
for lab in self.preferred_label:
labels[lab.short_language_code] = lab.label
labels[lab.language_code] = lab.label
return labels
def label(self, language_code=None, default_language_code='en'):
......
......@@ -51,8 +51,8 @@ class ViewsTC(testlib.CubicWebTC):
self.assertRaises(Redirect, scheme.view, 'skos.scheme.import')
self.assertEqual(set(c.dc_title() for c in scheme.top_concepts),
set(u'électro hip-hop rap jazz classique'.split()))
self.assertEqual(set(l.language_code for c in scheme.top_concepts
for l in c.preferred_label),
self.assertEqual(set(label.language_code for concept in scheme.top_concepts
for label in concept.preferred_label),
set(['fr']))
def test_lcsv_scheme_concepts_import(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment