Skip to Content
Menu
This question has been flagged
3 Replies
914 Views

Hi everyone,

I'm encountering a failing test while creating a development branch for odoo.sh (Odoo v17 latest). The error is as follows:

2024-09-05 23:09:07,902 4 INFO orgname-main-15141527 odoo.addons.bus.tests.test_notify: Starting NotifyTests.test_get_notify_payloads ...2024-09-05 23:09:07,904 4 INFO orgname-main-15141527 odoo.addons.bus.tests.test_notify: Starting NotifyTests.test_postcommit ...2024-09-05 23:09:07,923 4 INFO orgname-main-15141527 odoo.addons.bus.tests.test_notify: ======================================================================
2024-09-05 23:09:07,923 4 ERROR orgname-main-15141527 odoo.addons.bus.tests.test_notify: FAIL: NotifyTests.test_postcommit Traceback (most recent call last): File "/home/odoo/src/odoo/addons/bus/tests/test_notify.py", line 93, in test_postcommit self.assertEqual( AssertionError: Lists differ: [] != [['orgname-main-15141527', 'channe[49 chars] 2']] Second list contains 2 additional elements. First extra element 0: ['orgname-main-15141527', 'channel 1'] - [] + [['orgname-main-15141527', 'channel 1'], + ['orgname-main-15141527', 'channel 2']]

(Note: I've replaced the organization name with "orgname.")

Does anyone have an idea on how to resolve this? I'm not sure if I have control over this. Any help would be greatly appreciated!

Avatar
Discard
Best Answer

I have the same problem.  I haven't added any custom code.  I'm just trying to create a new Development branch and deploy it.

These are Odoo tests that are failing.

Avatar
Discard
Author Best Answer

The problem is I didn't write that test so I don't have access to it's source code. Am I missing something? 

Avatar
Discard
Best Answer

To resolve the error in Odoo v17:


1. Update the Test: Modify the assertion to expect the two channels if their creation is correct:

   

   self.assertEqual(result, [['orgname-main-15141527', 'channel 1'], ['orgname-main-15141527', 'channel 2']])

   


2. Review Post-Commit Logic: If the notifications aren't expected, check the post-commit logic and ensure unnecessary channels aren't created.


3. Mock Notification Calls: Use `unittest.mock.patch` to mock notifications during the test if needed.



Avatar
Discard
Related Posts Replies Views Activity
4
Aug 24
5445
0
Jan 24
651
0
Jun 24
473
0
Feb 20
4
0
Mar 15
2691