← Back to team overview

openerp-connector-community team mailing list archive

Re: Setup for unit tests?

 

On Thu, Mar 27, 2014 at 10:46 AM, Thomas Rehn <thomas.rehn@xxxxxxxxxx> wrote:
> Hi Guewen,
>
> On 27.03.2014 09:57, Guewen Baconnier wrote:
>> Glad to see you working with the tests.
>> Did you use the following command?
>>
>> $ bin/rununittests -m magentoerpconnect
>>
>> Did you observed that this command ignores the database?
>
> Yes. The tests use the correct database, but do not have the correct
> database host, user and password.
> If I set
>  config['db_password'] = 'XXX'
>  config['db_user'] = 'openerp_magento7'
>  config['db_host'] = 'localhost'

Ok, I got it. That's right, AFAIK there is no way to make
openerp-command use the config file, and the only option provided to
run_tests.py is --database.

> in openerp-command/openerpcommand/run_tests.py manually, everything
> works fine now. I get one failing test case because in my fresh database
> there is no period for 2013, but that is a different problem.

The database used for the tests should have the demo data installed.

>
>
>> If you open the bin/rununittests script what do you have in DBNAME ?
>
> The file contains:
> DBNAME=openerp_magento7
>
> But I do not see where I could configure database host, user and
> password. From having a closer look at the files, I guess this is not
> implemented yet.

I see 2 possibilities :
 - add the options --host, --db-user, --db-password in
bin/rununittests when it calls openerpcommand/run_tests.py. Needs to
be verified because I don't know if it accepts them. But if it works,
they could be added automatically by the buildout the same manner than
--database is set.
 - add rights to your user so it can access the database (only works
if the database is on localhost though)

>
> Thanks for your help.
>
> Best,
>  Thomas.


References