def test_valids(self): """ Tests that the output of the validate_postcode function has the expected result """ for postcode, expected_result in self.valid_postcodes: self.failUnlessEqual(validate_postcode(postcode), expected_result)
def clean(self, value): return validate_postcode(value, self.error_messages['invalid_postalcode'])