İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1966 Görünümler

Hello guys, 

I tried to test my module using API that I've been set using postman and it works but, when I try to use odoo.tests using this class 'TransactionCase'​ to create a new record it didn't work. 

see my python file in this link:

https://photos.app.goo.gl/uJDf33QZkojYqKEp7


and this is my odoo.log said:

...

2024-08-25 14:14:43,646 37828 INFO odoo_17 odoo.modules.registry: module estate: creating or updating database tables 2024-08-25 14:14:43,764 37828 INFO odoo_17 odoo.modules.loading: loading estate/security/ir.model.access.csv 2024-08-25 14:14:43,796 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/templates/email_templates.xml 2024-08-25 14:14:43,808 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/estate_property.xml 2024-08-25 14:14:43,837 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/estate_property_scheduler.xml 2024-08-25 14:14:43,855 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/estate_property_type.xml 2024-08-25 14:14:43,859 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/estate_property_offer.xml 2024-08-25 14:14:43,873 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/estate_property_tag.xml 2024-08-25 14:14:43,882 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/users.xml 2024-08-25 14:14:43,891 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/menu.xml 2024-08-25 14:14:43,920 37828 INFO odoo_17 odoo.modules.loading: loading estate/demo/estate_property_tag_demo.xml 2024-08-25 14:14:43,927 37828 INFO odoo_17 odoo.modules.loading: loading estate/data/estate.property.csv 2024-08-25 14:14:43,951 37828 INFO odoo_17 odoo.modules.loading: loading estate/views/reports/output_pdf/estate_property.xml 2024-08-25 14:14:43,989 37828 INFO odoo_17 odoo.modules.loading: Module estate loaded in 0.45s, 348 queries (+348 other) 2024-08-25 14:14:45,340 37828 INFO odoo_17 odoo.modules.loading: 98 modules loaded in 2.26s, 348 queries (+348 extra) 2024-08-25 14:14:45,901 37828 INFO odoo_17 odoo.modules.registry: verifying fields for every extended model 2024-08-25 14:14:46,661 37828 INFO odoo_17 odoo.modules.loading: Modules loaded. 2024-08-25 14:14:46,666 37828 INFO odoo_17 odoo.modules.registry: Registry loaded in 5.221s 2024-08-25 14:14:46,666 37828 INFO odoo_17 odoo.service.server: Starting post tests 2024-08-25 14:14:46,667 37828 INFO odoo_17 odoo.service.server: 0 post-tests in 0.00s, 0 queries


this is my command line to test:

C:\Odoo\python\python.exe" "C:\Odoo\server\odoo-bin" -d odoo_17 -i estate --test-enable


there is no line indicating testing method occurs. can somebody help me to fix this? if there some mistakes I would appreciate if you correct it

Avatar
Vazgeç
En İyi Yanıt

--test-tags=your_module_name too bro

Avatar
Vazgeç
Üretici

what do you mean? estate is my module name. give me your example how it written

Normally when i want to run test of a module i do like this
First: -d odoo_17 -i estate then shut down server
Seconde -d odoo17 --test-enable --test-tags=estate -> to run test case

Üretici

I don't know bro it still does not work

did you import test py file into init of test folder ?

Üretici

yes I did

include this in your test code
from odoo.tests import tagged

@tagged('post_install', '-at_install')
class TestEstatePropertyTag(TransactionCase)

Üretici

what the output then? I see no new record on my screen and in the odoo.log said:
2024-08-28 02:35:01,585 7476 INFO odoo_17 odoo.service.server: Starting post tests
2024-08-28 02:35:01,765 7476 INFO odoo_17 odoo.service.server: 0 post-tests in 0.18s, 0 queries

Not a clue , maybe i can investigate further if i have full of your code but i think you don't want to share it though.
I have written hundred of tests already :v

Üretici

do you want my module? so you can check it.
this is my module, I put it in googel drive
https://drive.google.com/drive/folders/1hLEyq95-aR_cfhbwLcl_c7pvC1Rq8sdK?usp=sharing

Hello i think you should change folder name 'model_testing' to 'tests' then try again

Üretici

is it necessary to named the folder with 'tests'?
problem solved
thanks man you saved my life

yes it is a must, odoo find that folder with name tests to perform test

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Haz 23
4358
1
May 24
1559
1
Haz 18
3788
1
May 25
1037
3
Kas 24
30365