Author: bbangert
Date: 2006-01-26 11:53:31 -0700 (Thu, 26 Jan 2006)
New Revision: 1542
Modified:
FormEncode/trunk/tests/test_sqlschema.py
Log:
Tests weren't passing as validators.String will return an empty string, not
None (which is apparently the correct behavior), and the id is not str'd by the
SQL Schema which also appears to be correct (assuming the actual code is
correct).
Modified: FormEncode/trunk/tests/test_sqlschema.py
===================================================================
--- FormEncode/trunk/tests/test_sqlschema.py 2006-01-26 17:33:29 UTC (rev
1541)
+++ FormEncode/trunk/tests/test_sqlschema.py 2006-01-26 18:53:31 UTC (rev
1542)
@@ -54,17 +54,17 @@
def test_defaults():
res = EventObjectSchema().from_python(None)
- assert res == dict(date=None, description=None)
+ assert res == dict(date=None, description='')
obj = EventObject(name='foobar2', date=date(2020, 10, 1),
description=None)
res = EventObjectSchema(wrap=obj).from_python(None)
- assert res == dict(id=str(obj.id), date='10/01/2020',
- name='foobar2', description=None)
+ assert res == dict(id=obj.id, date='10/01/2020',
+ name='foobar2', description='')
obj2 = EventObject(name='bar', date=date(2002, 10, 1),
description='foobarish')
# @@: Should this give an error?
res = EventObjectSchema(wrap=obj).from_python(obj2)
- assert res == dict(id=str(obj2.id), date='10/01/2002',
+ assert res == dict(id=obj2.id, date='10/01/2002',
name='bar', description='foobarish')
res2 = EventObjectSchema().from_python(obj2)
assert res2 == res
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs