Exemplo n.º 1
0
 def test__render(self):
     w = MultiEmailWidget()
     output = w.render('test', ['*****@*****.**', '*****@*****.**'])
     self.assertEqual(1, len(pq('textarea', output)))
     self.assertEqual(
         pq('textarea', output).text(),
         '[email protected],[email protected]')
 def test__render(self):
     w = MultiEmailWidget()
     output = w.render('test', ['*****@*****.**', '*****@*****.**'])
     self.assertEqual(1, len(pq('textarea', output)))
     # The template-based widget add a line-return
     value = pq('textarea', output).text()
     self.assertEqual(value.lstrip(), '[email protected]\[email protected]')
Exemplo n.º 3
0
 def test__prep_value__list(self):
     w = MultiEmailWidget()
     value = w.prep_value(['*****@*****.**', '*****@*****.**'])
     self.assertEqual(value, '[email protected],[email protected]')
Exemplo n.º 4
0
 def test__prep_value__string(self):
     w = MultiEmailWidget()
     value = w.prep_value('[email protected]\[email protected]')
     self.assertEqual(value, '[email protected]\[email protected]')
Exemplo n.º 5
0
 def test__prep_value__empty(self):
     w = MultiEmailWidget()
     value = w.prep_value('')
     self.assertEqual(value, '')
 def test__prep_value__raise(self):
     w = MultiEmailWidget()
     self.assertRaises(ValidationError, w.prep_value, 42)
 def test__prep_value__list(self):
     w = MultiEmailWidget()
     value = w.prep_value(['*****@*****.**', '*****@*****.**'])
     self.assertEqual(value, '[email protected]\[email protected]')
 def test__prep_value__string(self):
     w = MultiEmailWidget()
     value = w.prep_value('[email protected]\[email protected]')
     self.assertEqual(value, '[email protected]\[email protected]')
 def test__prep_value__empty(self):
     w = MultiEmailWidget()
     value = w.prep_value('')
     self.assertEqual(value, '')
Exemplo n.º 10
0
 def test__render(self):
     w = MultiEmailWidget()
     output = w.render('test', ['*****@*****.**', '*****@*****.**'])
     self.assertEqual(1, len(pq('textarea', output)))
     self.assertEqual(
         pq('textarea', output).text(), '[email protected] [email protected]')