Proteus success

47 views
Skip to first unread message

Cato Nano

unread,
Feb 2, 2018, 2:39:10 AM2/2/18
to tryton
My Bolletta needed to sport a "Total" field that had to be the sum of a field in its lines.

I arranged a draft of a couple clculated field/on_change method and then I tested it in proteus.

My draft works !

In [7]: boll.totale
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/model/fields/function.py:100: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
if 'names' in inspect.getargspec(method)[0]:
Out[7]: 2016.014


I don' t undertsand the warning becaus I don' t know how the code underneath is layed out, but do you see the number 2016.014 ?

That' s my total !!

This is a way saner cycle than creating the xml for the fields, then logging in the client, open all the windows to reach the new field !!

Sergi Almacellas Abellana

unread,
Feb 2, 2018, 4:19:18 AM2/2/18
to try...@googlegroups.com
El 02/02/18 a les 08:39, Cato Nano ha escrit:
> That' s my total !!
>
> This is a way saner cycle than creating the xml for the fields, then logging in the client, open all the windows to reach the new field !!
We normally use proteus to create doctest scenarios that ensure the
module behaves as expected. Have a look at the docs:

http://doc.tryton.org/4.6/trytond/doc/topics/testing.html


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Cato Nano

unread,
Feb 11, 2018, 6:03:57 AM2/11/18
to tryton
Il giorno venerdì 2 febbraio 2018 10:19:18 UTC+1, Sergi Almacellas Abellana ha scritto:
> El 02/02/18 a les 08:39, Cato Nano ha escrit:
> > That' s my total !!
> >
> > This is a way saner cycle than creating the xml for the fields, then logging in the client, open all the windows to reach the new field !!
> We normally use proteus to create doctest scenarios that ensure the
> module behaves as expected. Have a look at the docs:
>
> http://doc.tryton.org/4.6/trytond/doc/topics/testing.html

I tried to add some tests but they don' t get run

In fact I added a test that should fail but when I run the tests they all pass :-/

Here
https://gitlab.com/humanitiesNerd/tributi/blob/master/tests/scenario_affissioni.rst#L66


The correct value should be
datetime.date(2019, 10, 16)

but instead I wrote
datetime.date(2019, 10, 17)

just to see a test fail

It doesn' t

it always run 13 tests

This is what i get

(env) [catonano@localhost tributi] $ ./run-tests.py -m tributi -v
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead.
module_config.readfp(fp)
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead.
module_config.readfp(fp)
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:281: UserWarning: Unable to remove not null with SQLite backend
warnings.warn('Unable to remove not null with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:245: UserWarning: Unable to drop foreign key with SQLite backend
warnings.warn('Unable to drop foreign key with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:289: UserWarning: Unable to drop constraint with SQLite backend
warnings.warn('Unable to drop constraint with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:176: UserWarning: Unable to set default on column with SQLite backend
warnings.warn('Unable to set default on column with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:279: UserWarning: Unable to set not null with SQLite backend
warnings.warn('Unable to set not null with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:286: UserWarning: Unable to add constraint with SQLite backend
warnings.warn('Unable to add constraint with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:242: UserWarning: Unable to add foreign key with SQLite backend
warnings.warn('Unable to add foreign key with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/model/fields/function.py:100: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
if 'names' in inspect.getargspec(method)[0]:
.............
----------------------------------------------------------------------
Ran 13 tests in 8.592s

OK
(env) [catonano@localhost tributi] $


I' m using this file, I just copied it from the Trytond repository
https://gitlab.com/humanitiesNerd/tributi/blob/master/run-tests.py


Message has been deleted

Cato Nano

unread,
Feb 11, 2018, 2:29:26 PM2/11/18
to tryton
ok, I was failing to build the project before running the tests

I'm sorry for bothering :-/

Reply all
Reply to author
Forward
0 new messages