diff options
| author | Aurélien Warnon <awa@odoo.com> | 2019-12-12 12:17:40 +0000 |
|---|---|---|
| committer | Aurélien Warnon <awa@odoo.com> | 2019-12-12 13:38:51 +0000 |
| commit | 648bbbec9a66bf69b00c3a28f4d95bffebf65246 (patch) | |
| tree | dfba667f52562e688c562c2a68f73a514b18e077 /addons/website_slides/tests/test_statistics.py | |
| parent | 7876af3ad0f35d4e0ac2839546aef6fd0bc117e1 (diff) | |
[FIX] website_slides: fix slide.slide statistics compute method
The slide.slide and slide.channel "_compute_slides_statistics" methods do not
always assign a default value for the "total_slides" field.
This can cause some CacheMiss and seem related to nondeterministic errors on
the runbot.
Task#2123711
Runbot build error ID 247
closes odoo/odoo#41942
X-original-commit: c240d04ed0518897f76b315cd354ea6606aea645
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/website_slides/tests/test_statistics.py')
| -rw-r--r-- | addons/website_slides/tests/test_statistics.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/website_slides/tests/test_statistics.py b/addons/website_slides/tests/test_statistics.py index 80ce7e5b7e6..79f0745aa2c 100644 --- a/addons/website_slides/tests/test_statistics.py +++ b/addons/website_slides/tests/test_statistics.py @@ -165,6 +165,7 @@ class TestSlideStatistics(common.SlidesCase): category.nbr_document, len(category.channel_id.slide_ids.filtered(lambda s: s.category_id == category and s.slide_type == 'document'))) + self.assertEqual(self.channel.total_slides, 3, 'The channel should contain 3 slides') self.assertEqual(category.total_slides, 2, 'The first category should contain 2 slides') other_category = self.env['slide.slide'].with_user(self.user_officer).create({ 'name': 'Other Category', @@ -179,3 +180,4 @@ class TestSlideStatistics(common.SlidesCase): self.slide_3.write({'sequence': 6}) self.assertEqual(category.total_slides, 1, 'The first category should contain 1 slide') self.assertEqual(other_category.total_slides, 1, 'The other category should contain 1 slide') + self.assertEqual(self.channel.total_slides, 3, 'The channel should still contain 3 slides') |
