We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class TestFormExceptions(TestCase): def test_exceptions(self): class DatingProfile(pilo.Form): genders = ['male', 'female', 'neutral'] name = String() email = String() postal_code = String(length=5) blurb = String(max_length=100) gender = String(choices=genders) sexual_preferences = List(String(choices=genders)) likes = List(String()) # Two field errors DatingProfile( name='William Henry Cavendish III', email='[email protected]', postal_code='9021', # Invalid postal code blurb='I am a test fixture', gender='male', sexual_preferences=['female', 'neutral'], # Likes parameter missing )
====================================================================== ERROR: test_exceptions (tests.test_fields.TestFormExceptions) ---------------------------------------------------------------------- Traceback (most recent call last): File "pilo/tests/test_fields.py", line 424, in test_exceptions DatingProfile(**profile_params_with_two_errors) File "pilo/pilo/fields.py", line 1581, in __init__ RaiseErrors()(*errors) File "pilo/pilo/fields.py", line 160, in __call__ raise ex[0] Invalid: postal_code - "9021" must have length >= 5
The text was updated successfully, but these errors were encountered:
#15
Sorry, something went wrong.
Here is what the error looks like with PR #15:
====================================================================== ERROR: test_exceptions (tests.test_fields.TestFormExceptions2) ---------------------------------------------------------------------- Traceback (most recent call last): File "pilo/tests/test_fields.py", line 482, in test_exceptions sexual_preferences=['female', 'neutral'], File "pilo/pilo/fields.py", line 1570, in __init__ RaiseErrors()(*errors) File "pilo/pilo/fields.py", line 148, in __call__ raise FormError(*field_errors) FormError: * Invalid: postal_code - "9021" must have length >= 5 * Missing: likes - missing
No branches or pull requests
The text was updated successfully, but these errors were encountered: