|
|
|
Tryton simple business test scenario with proteus.
Start tests with:
$ python -m doctest -v scenario_simple.rst
N.B. Proteus must be in PYTHONPATH or linked into the tests/ directory.
For now you need to patch the Proteus client library with the patch given by this review:
http://codereview.appspot.com/2586041
Patch Set 1 #Patch Set 2 : Set config to sqlite :memory: #
Total comments: 18
Patch Set 3 : Add feedback, remove debug to comments #Patch Set 4 : Add tracebacks to the lines which produce them #Patch Set 5 : Invoice creation is working now. Factor out general documentation #Total messages: 14
|
udono
On my installation all steps working well, but invoice creation fails. Maybe you find the ...
|
15 years, 2 months ago (2010年10月18日 13:52:48 UTC) #1 |
On my installation all steps working well, but invoice creation fails. Maybe you find the mistake?
Looks pretty good. Once you're finished with the technical review, I'm happy to proofread and edit the prose for grammatical correctness, if you wish. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst File scenario_simple.rst (right): http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode507 scenario_simple.rst:507: >>> (supplier_tax,) = Tax.find([ You've already defined supplier_tax and customer_tax at lines 481 and 485... do you need to do it again?
Will test later http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst File scenario_simple.rst (right): http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode2 scenario_simple.rst:2: Simple Busines Scenarios Business http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode11 scenario_simple.rst:11: recipe. This implies, that each step could need one or more predessessing predecessing http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode17 scenario_simple.rst:17: The testing aspect of this document should ensure that Tryton runs as an runs the way http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode18 scenario_simple.rst:18: end user would expect it to run in a defined setup. These tests dependend depend http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode20 scenario_simple.rst:20: No other modules are expected. required. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode23 scenario_simple.rst:23: business procedures. Tests are restricted to successful try are restricted to test the success... http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode24 scenario_simple.rst:24: out given functionalities and beating user level errors and and defeat user level errors... http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode28 scenario_simple.rst:28: Business level tests should be usefull to detect regressions in main useful
Haven't you any traceback when the invoice creation fail ?
On 2010年10月18日 14:52:18, bch wrote:
> Haven't you any traceback when the invoice creation fail ?
Yes, I have:
>>> invoice.lines.append(invoice_line1)
Trying:
invoice.lines.append(invoice_line1)
Expecting nothing
**********************************************************************
File "setup.rst", line 666, in scenario_simple.rst
Failed example:
invoice.lines.append(invoice_line1)
Exception raised:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "proteus/__init__.py", line 192, in append
self._changed()
File "proteus/__init__.py", line 179, in _changed
self.parent._on_change(self.parent_field_name)
File "proteus/__init__.py", line 536, in _on_change
self._set_on_change(field, value)
File "proteus/__init__.py", line 504, in _set_on_change
list.append(getattr(self, field), relation(*vals))
TypeError: __init__() takes at most 2 arguments (11 given)
Here I checked the values in proteus/__init__.py:
>>> field, value: taxes {'account': 8, 'description': u'Received tax', 'manual':
False, 'tax': 1, 'base_sign': Decimal('1.0'), 'tax_code': 5, 'amount':
Decimal('20.00'), 'base': Decimal('100.00'), 'base_code': 2, 'tax_sign':
Decimal('1.0')}
Then following some other (dependend) errors
On 2010年10月18日 14:29:06, pheller wrote: > Looks pretty good. > > Once you're finished with the technical review, I'm happy to proofread and edit > the prose for grammatical correctness, if you wish. > > http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst > File scenario_simple.rst (right): > > http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode507 > scenario_simple.rst:507: >>> (supplier_tax,) = Tax.find([ > You've already defined supplier_tax and customer_tax at lines 481 and 485... do > you need to do it again? It seems I need to have them goth time, because I get problems with an error about supplier_tax_parent is None or something like this.
http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst File scenario_simple.rst (right): http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode2 scenario_simple.rst:2: Simple Busines Scenarios On 2010年10月18日 14:31:25, yangoon wrote: > Business Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode11 scenario_simple.rst:11: recipe. This implies, that each step could need one or more predessessing On 2010年10月18日 14:31:25, yangoon wrote: > predecessing Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode17 scenario_simple.rst:17: The testing aspect of this document should ensure that Tryton runs as an On 2010年10月18日 14:31:25, yangoon wrote: > runs the way Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode18 scenario_simple.rst:18: end user would expect it to run in a defined setup. These tests dependend On 2010年10月18日 14:31:25, yangoon wrote: > depend Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode20 scenario_simple.rst:20: No other modules are expected. On 2010年10月18日 14:31:25, yangoon wrote: > required. I put No other modules are required or expected. I wanted to say, that this script is solely for testing www.tryton.org. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode23 scenario_simple.rst:23: business procedures. Tests are restricted to successful try On 2010年10月18日 14:31:25, yangoon wrote: > are restricted to test the success... Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode24 scenario_simple.rst:24: out given functionalities and beating user level errors and On 2010年10月18日 14:31:25, yangoon wrote: > and defeat user level errors... Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode28 scenario_simple.rst:28: Business level tests should be usefull to detect regressions in main On 2010年10月18日 14:31:25, yangoon wrote: > useful Done. http://codereview.appspot.com/2550042/diff/3001/scenario_simple.rst#newcode507 scenario_simple.rst:507: >>> (supplier_tax,) = Tax.find([ On 2010年10月18日 14:29:06, pheller wrote: > You've already defined supplier_tax and customer_tax at lines 481 and 485... do > you need to do it again? Yes, for the moment we need to use an object only once ina a one2many or many2many. See http://www.tryton.org/~irclog/2010-10-18.log.html#t2010-10-18_22:31
On 2010年10月18日 14:52:18, bch wrote: > Haven't you any traceback when the invoice creation fail ? All is ok now. Invoice is created.
On 2010年10月18日 15:45:21, udono wrote: > On 2010年10月18日 14:29:06, pheller wrote: > > Once you're finished with the technical review, I'm happy to proofread and > edit > > the prose for grammatical correctness, if you wish. This would be great! But maybe wait a little bit, since the general idea is still unclear.
> This would be great! But maybe wait a little bit, since the general idea is > still unclear. I love this shit! - fully automated client testing, plus: - the best documentation of the programming model I've seen to date. muchas gracias!