Example #1
0
 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')
Example #2
0
 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')
Example #3
0
 def test_discovery_module_form_bad_locale(self):
     d = dict(app=1, module='xx', locales='fake')
     form = DiscoveryModuleForm(d)
     assert form.errors['locales']
Example #4
0
 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'])
Example #5
0
 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")
Example #6
0
 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'])