sort langtool add-ons before groupby (bug 578826)
This commit is contained in:
Родитель
57326ebf07
Коммит
5fceab4c53
|
@ -64,7 +64,7 @@ class TestLanguageTools(amo.test_utils.ExtraSetup, test_utils.TestCase):
|
|||
def test_packs_and_dicts(self):
|
||||
ca = dict(self.locales)['ca-valencia']
|
||||
eq_(len(ca.dicts), 1)
|
||||
eq_(len(ca.packs), 2)
|
||||
eq_(len(ca.packs), 3)
|
||||
|
||||
def test_empty_target_locale(self):
|
||||
"""Make sure nothing breaks with empty target locales."""
|
||||
|
|
|
@ -70,7 +70,7 @@ def _get_locales(addons):
|
|||
'locale_disambiguation': addon.locale_disambiguation}
|
||||
|
||||
locales = {}
|
||||
for locale, addons in itertools.groupby(addons, lambda x: x.target_locale):
|
||||
for locale, addons in amo.utils.sorted_groupby(addons, 'target_locale'):
|
||||
addons = list(addons)
|
||||
dicts = [slim(a) for a in addons if a.type == amo.ADDON_DICT]
|
||||
packs = [slim(a) for a in addons if a.type == amo.ADDON_LPAPP]
|
||||
|
|
Загрузка…
Ссылка в новой задаче