Ian Bicking wrote:
> Okay, *this* time! Finally wrote the dumb unit test...
Almost there! :-) I have one failure:
>>> from test import *
>>> cc = ComponentCategory.new(name="CAT")
>>> cc
<ComponentCategory 3 name='CAT' description=None sequenceNum=None>
Create component with default None for category:
>>> c = Component.new(name="Mad")
>>> c
<Component 9 name='Mad' categoryId=None sequenceNum=None>
>>> c.category
Try assigning instance of ComponentCategory to category attribute:
>>> c.category = cc
>>> c.category
<ComponentCategory 3 name='CAT' description=None sequenceNum=None>
Now try creating component while passing in an instance of
ComponentCategory:
>>> c = Component.new(name="Mad", category=cc)
>>> c
<Component 10 name='Mad' categoryId='3' sequenceNum=None>
>>> c.category
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/SQLObject/SQLObject.py", line
928, in __repr__
' '.join(['%s=%s' % (name, repr(value)) for name, value in
self._reprItems()]))
TypeError: an integer is required
...Edmund.
|