Skip to content

Conversation

@AhmedNassar7
Copy link
Contributor

Trac ticket number

ticket-35986

Branch description

Replace class-level @translation.override decorator with enterClassContext() in
test classes. This ensures proper test discovery and execution of test classes
using translation overrides.

Changes made:

  • Updated test classes to use enterClassContext() instead of decorator
  • Fixed test discovery for timezone-related test classes
  • Ensures consistent behavior across test runners

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

Co-authored-by: Simon Charette <charette.s@gmail.com>
@sarahboyce sarahboyce changed the title Fixed #35986 -- Fixed test classes with @translation.override decorator Fixed #35986 -- Fixed test classes with @translation.override decorator. Apr 8, 2025
Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Thank you! This looks good to me

@sarahboyce sarahboyce merged commit 522dd02 into django:main Apr 9, 2025
20 checks passed
Convert a datetime to UTC.
"""
return do_timezone(value, datetime.UTC)
return do_timezone(value, UTC)
Copy link
Member

Choose a reason for hiding this comment

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

This is a fix for regression in efb7f9c, not related with this patch.

Copy link
Member

Choose a reason for hiding this comment

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

It seems that we don't have tests for the utc filter 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

It did start to fail with these changes as some tests started to "run" which were not running before
But you're right it should have been two commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants