Hi,
I'm thinking on the possibility of creating a new standard test (such as the
one on views and depends) that would try to help us ensuring we test all CRUD
+ Browse operations on all models. I think that can be nice if we change the
create() API to allow multiple records at once but will also help us find out
problems with existing functions and models.
The goals would be to ensure that the following functions work correctly with
a single value or a list of them for *all* SQL models:
- create
- read
- write
- delete
- browse
I've been thinking in something like this:
from trytond.tests.test_tryton import test_crud
class MyTest(unittest.TestCase):
def test0007crud(self):
test_crud(
('res.partner', [
{'name': 'Sample Partner Name'},
{'name': 'Sample Partner Name to avoid duplicates'},
]),
('res.partner', None), # This one will not be tested
])
After execution we could get a list of models which have not been tested, and
the function would be in charge of doing all the tests I mentioned above.
To be sincere, I don't like my own proposal, and it has it issues with models
that have required Many2One fields. I don't really know how to do that smartly
but I feel it would benefit us to have something to check those basic
operations easily. Note, for example, that we do not have tests for such
operations in a model as important as product.product.
So what I'd like is to have more brains giving it a thought. What do you
think? Would it be worth it? Some cool ideas anyone?
--
Albert Cervera i Areny
http://www.NaN-tic.com
Tel: +34 93 553 18 03
http://twitter.com/albertnan
http://www.nan-tic.com/blog
--
[email protected] mailing list