def test_discovery_module_form_dedupe(self): d = dict(app=amo.FIREFOX.id, module='xx', locales='en-US he he fa fa') form = DiscoveryModuleForm(d) assert form.is_valid() eq_(form.cleaned_data['locales'], 'fa en-US he')
def test_discovery_module_form_bad_locale(self): d = dict(app=1, module='xx', locales='fake') form = DiscoveryModuleForm(d) assert form.errors['locales']
def test_discovery_module_form_dedupe(self): d = dict(app=amo.FIREFOX.id, module='xx', locales='en-US he he fa fa') form = DiscoveryModuleForm(d) assert form.is_valid() cleaned_locales = form.cleaned_data['locales'].split() eq_(sorted(cleaned_locales), ['en-US', 'fa', 'he'])
def test_discovery_module_form_dedupe(self): d = dict(app=amo.FIREFOX.id, module="xx", locales="en-US he he fa fa") form = DiscoveryModuleForm(d) assert form.is_valid() eq_(form.cleaned_data["locales"], "fa en-US he")