class SeparatedValuesFieldTestCase(TestCase): def setUp(self): self.field = SeparatedValuesField(forms.EmailField) def test_email_field(self): eq_(self.field.clean(u'[email protected], [email protected]'), u'[email protected], [email protected]') def test_email_field_w_empties(self): eq_(self.field.clean(u'[email protected],, \n,[email protected]'), u'[email protected], [email protected]') def test_email_validation_error(self): with self.assertRaises(exceptions.ValidationError): self.field.clean(u'e') with self.assertRaises(exceptions.ValidationError): self.field.clean(u'[email protected], [email protected], e') def test_url_field(self): field = SeparatedValuesField(forms.URLField) eq_(field.clean(u'http://hy.fr/,,http://yo.lo'), u'http://hy.fr/, http://yo.lo') def test_alt_separator(self): self.field = SeparatedValuesField(forms.EmailField, separator='#') eq_(self.field.clean(u'[email protected]#[email protected]'), u'[email protected], [email protected]')
class SeparatedValuesFieldTestCase(amo.tests.TestCase): def setUp(self): self.field = SeparatedValuesField(forms.EmailField) def test_email_field(self): eq_(self.field.clean(u'[email protected], [email protected]'), u'[email protected], [email protected]') def test_email_field_w_empties(self): eq_(self.field.clean(u'[email protected],, \n,[email protected]'), u'[email protected], [email protected]') def test_email_validation_error(self): with self.assertRaises(exceptions.ValidationError): self.field.clean(u'e') with self.assertRaises(exceptions.ValidationError): self.field.clean(u'[email protected], [email protected], e') def test_url_field(self): field = SeparatedValuesField(forms.URLField) eq_(field.clean(u'http://hy.fr/,,http://yo.lo'), u'http://hy.fr/, http://yo.lo/') def test_alt_separator(self): self.field = SeparatedValuesField(forms.EmailField, separator='#') eq_(self.field.clean(u'[email protected]#[email protected]'), u'[email protected], [email protected]')
def test_url_field(self): field = SeparatedValuesField(forms.URLField) eq_(field.clean(u'http://hy.fr/,,http://yo.lo'), u'http://hy.fr/, http://yo.lo/')
def test_url_field(self): field = SeparatedValuesField(forms.URLField) eq_(field.clean(u'http://hy.fr/,,http://yo.lo'), u'http://hy.fr/, http://yo.lo')