bninja / pilo Goto Github PK
View Code? Open in Web Editor NEWLicense: ISC License
License: ISC License
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
https://github.com/bninja/pilo/blob/master/pilo/fields.py#L425
would be nice if this logic was
if callable(self.default):
return self.default()
or is there a better way to compute defaults?
git tag
releases are not correctly tagged, they should lie in the master
branch, but it is not the case.
consider ec32d94 (tag: v0.6.0) release v0.6.0
which is not "inside" the master
tree and then a62f43c release v0.6.0
which is but is not tagged
* a62f43c release v0.6.0
* 8c93870 Merge pull request #10 from bninja/poly-clone
|\
| | * ec32d94 (tag: v0.6.0) release v0.6.0
| |/
| * a7b2cad release instructions
| * d0b078c clone fields for type probe
|/
* eab1693 Merge pull request #8 from cieplak/test-coverage
Why are they two semantically different things?
@mjallday and I need write access to this. The cycle of waiting to update dependencies is a day and is a real blocker. The other option is to fork.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.