def test_initial_not_in_EMPTY_VALUES_and_value_is_not_equal_to_initial( self): field = HoneypotField(initial='foobar') with self.assertRaises(ValidationError): field.clean('pizza')
def test_initial_not_in_EMPTY_VALUES_and_value_is_not_equal_to_initial(self ): field = HoneypotField(initial='foobar') with self.assertRaises(ValidationError): field.clean('pizza')
def test_initial_not_in_EMPTY_VALUES_and_value_is_equal_to_initial(self): field = HoneypotField(initial='foobar') output = field.clean('foobar') self.assertEqual(output, 'foobar')
def test_initial_and_value_in_EMPTY_VALUES(self): field = HoneypotField(initial=None) output = field.clean('') self.assertEqual(output, '')
def test_initial_not_in_EMPTY_VALUES_and_value_is_equal_to_initial(self): field = HoneypotField(initial='foobar') output = field.clean('foobar') self.assertEqual(output, 'foobar')
def test_initial_and_value_in_EMPTY_VALUES(self): field = HoneypotField(initial=None) output = field.clean('') self.assertEqual(output, '')