Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: SOLVED (but why ??) Re: odoo 10 does not find any tests

by
Sunflower IT, Tom Blauwendraat
- 29/11/2017 00:20:58
Ok, i can understand how this would execute your test, but it's definitely not good practice :-) This is more like "execute this function after module install"

Another shot in the dark, but where is your test file located? In the "tests" subfolder of your module? Or somewhere else or in "test"...


On Tue, Nov 28, 2017 at 11:46 PM, robert <robert@redcor.ch> wrote:

Hi there,


thanks for the many answers I did get.

in the end the solution was not among them, but I hat to add a

@post_install(True)

decorator to the test method.

but why?

my test module now looks like this:


# -*- encoding: utf-8 -*-
from odoo.tests.common import TransactionCase, post_install

class TestRedhelpdesk(TransactionCase):
   
    def setUp(self, *args, **kwargs):
        super(TestRedhelpdesk, self).setUp(*args, **kwargs)
        print 'holla*' * 10
       
    @post_install(True)   # <--------------------------- change
    def test_print_rs(self):
        "print a string of rs"
        print 'r' * 66
        self.assertFalse(1, '1 is not false')
       

thanks again

robert



On 28.11.2017 22:31, Richard deMeester wrote:
<blockquote type="cite" cite="mid:CADo92831TRwRyrQWKXR911CXBvt7039-g+QXTRn_4=33HvAcrw@mail.gmail.com">
Use
 
-i module-name

 on the command line....

On 28 November 2017 at 23:17, Miku Laitinen <miku@avoin.systems> wrote:
It seems you didn't define a database in your command. Can you try it with explicitly defining a database and posting the logs if it doesn't work?

- Miku

On Tue, Nov 28, 2017 at 1:17 PM Tom B <antiflu@gmail.com> wrote:
It will also fail silently when the module is not installed in your db currently

Op 28 nov. 2017 12:02 schreef "Ronald Portier" <ronald@therp.nl>:
Hi Robert,

Two more things to check:
--log-level=test

And has your module demo data loaded? Actually wether there is any demo
data or not is not important (unless your tests depend on that data).
You can just set demo = true in ir_module_module table through sql.

Kind regards,

Ronald


On 28-11-17 09:32, robert wrote:
> Hi there,
> 
> 
> I try to add test to a module and do call them like this:
> 
> bin/start_openerp  --test-enable -u redhelpdesk --stop-after-init
> 
> the file with the tests is loaded, but none of the tests are run.
> 
> can anybody give me a hint, what I am doing wrong?
> thanks
> Robert
> 
> 
> this is the setting:
> 
> redhelpdesk
>      ...
>      tests
>          __init__.py
> 
>              from . import test_redhelpdesk
> 
>      test_redhelpdesk.py
> 	with the following content:
> 
> # -*- encoding: utf-8 -*-
> from odoo.tests.common import TransactionCase
> 
> class TestRedhelpdesk(TransactionCase):
> 
>      def setUp(self, *args, **kwargs):
>          super(TestRedhelpdesk, self).setUp(*args, **kwargs)
>          print 'holla*' * 10
> 
>      def test_print_rs(self):
>          "print a string of rs"
>          print 'r' * 66
>          self.assertFalse(1, '1 is not false')
> 
> 
> 
> 	
> 
> _______________________________________________
> Mailing-List: https://odoo-community.org/groups/contributors-15

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

--
Miku Laitinen
AVOIN.SYSTEMS

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe




--

 

Richard deMeester

Senior Development Analyst

WilldooIT Pty Ltd

E: richardd@willdooit.com | P: +61 3 9135 1900 | M: +61 403 76 76 76

A: 10/435 Williamstown Road, Port Melbourne, Vic 3207


C:\Users\nicholass\Downloads\WilldooIT signature.png

DISCLAIMER | This electronic message together with any attachments is confidential. If you are not the recipient, do not copy, disclose, or use the contents in any way. Please also advise us by e-mail that you have received this message in error and then please destroy this email and any of its attachments. WilldooIT Pty. Ltd. is not responsible for any changes made to this message and/or any attachments after sending by WilldooIT Pty. Ltd. WilldooIT Pty. Ltd. use virus scanning software but exclude all liability for virus or anything similar in this email or attachment.


_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


Reference