Exemplo n.º 1
0
 def test_field2boolean_with_emtpy_list(self):
     from ZPublisher.Converters import field2boolean
     to_convert = []
     expected = False
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 2
0
 def test_field2boolean_with_some_string(self):
     from ZPublisher.Converters import field2boolean
     to_convert = u'to_convert'
     expected = True
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 3
0
 def test_field2boolean_with_positive_int(self):
     from ZPublisher.Converters import field2boolean
     to_convert = 1
     expected = True
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 4
0
 def test_field2boolean_with_False_as_string(self):
     from ZPublisher.Converters import field2boolean
     to_convert = u'False'
     expected = False
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 5
0
 def test_field2boolean_with_emtpy_list(self):
     from ZPublisher.Converters import field2boolean
     to_convert = []
     expected = False
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 6
0
 def test_field2boolean_with_positive_int(self):
     from ZPublisher.Converters import field2boolean
     to_convert = 1
     expected = True
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 7
0
 def test_field2boolean_with_some_string(self):
     from ZPublisher.Converters import field2boolean
     to_convert = u'to_convert'
     expected = True
     self.assertEqual(field2boolean(to_convert), expected)
Exemplo n.º 8
0
 def test_field2boolean_with_False_as_string(self):
     from ZPublisher.Converters import field2boolean
     to_convert = u'False'
     expected = False
     self.assertEqual(field2boolean(to_convert), expected)