Skip to content

[19.0][FIX] website_event_filter_city: freeze_time test to avoid event not showing once that date passes. - #551

Merged
OCA-git-bot merged 3 commits into
OCA:19.0from
Tecnativa:19.0-fix-website_event_filter_city
Sep 16, 2026
Merged

OCA-git-bot merged 3 commits into
OCA:19.0from
Tecnativa:19.0-fix-website_event_filter_city

Conversation

@eduezerouali-tecnativa

Copy link
Copy Markdown
Contributor

cc @Tecnativa
ping @pedrobaeza @adasatorres-tecnativa

Tours were failing due to date_end being hardcoded (2026-09-15), so it no longer appears on /event once that date
passes. Use dates relative to fields.Datetime.now() instead.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @pilarvargas-tecnativa,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:19.0 mod:website_event_filter_city Module website_event_filter_city labels Sep 16, 2026

@adasatorres-tecnativa adasatorres-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pedrobaeza pedrobaeza added this to the 19.0 milestone Sep 16, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

You may hardcode dates, but if you use freeze_time, you will get the same time interval. The problem of variable dates may have problems at midnight due to timezones. Can you assure this is not the case? If problematic, do the freeze_time one.

@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 19.0-fix-website_event_filter_city branch from a2dc270 to 207e32a Compare September 16, 2026 07:22
@eduezerouali-tecnativa eduezerouali-tecnativa changed the title [19.0][FIX] website_event_filter_city: fix dates on test so they are not hardcoded [FIX] website_event_filter_city: freeze_time test to avoid event not showing once that date passes. Sep 16, 2026
@eduezerouali-tecnativa

Copy link
Copy Markdown
Contributor Author

You may hardcode dates, but if you use freeze_time, you will get the same time interval. The problem of variable dates may have problems at midnight due to timezones. Can you assure this is not the case? If problematic, do the freeze_time one.

I can not assure that will not happen, should not be the case. Anyway I took freeze_time path as it looks more safe.
Thanks Pedro.

@eduezerouali-tecnativa eduezerouali-tecnativa changed the title [FIX] website_event_filter_city: freeze_time test to avoid event not showing once that date passes. [19.0][FIX] website_event_filter_city: freeze_time test to avoid event not showing once that date passes. Sep 16, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

It seems to not work, as the test is frozen.

@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 19.0-fix-website_event_filter_city branch from 207e32a to fd95a3f Compare September 16, 2026 08:38
@pedrobaeza

Copy link
Copy Markdown
Member

So finally is not possible to use freeze_time?

@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 19.0-fix-website_event_filter_city branch from 59243b6 to 0d1007f Compare September 16, 2026 12:05
@eduezerouali-tecnativa

Copy link
Copy Markdown
Contributor Author

It pass on local environment, but neither pass OCA CI o our CI. It should be possible to use it as tour goes through but it never terminates the chrome.

So rollback to first option as is the way odoo manage that case https://github.com/odoo/odoo/blob/47bf5e2e5e91cfbebd30ee83fc92441d551001d3/addons/website_event/tests/test_website_event.py#L59-L66.

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's continue that way.

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-551-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 74dc7c1 into OCA:19.0 Sep 16, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at be2fe6c. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza
pedrobaeza deleted the 19.0-fix-website_event_filter_city branch September 16, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants