Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI: Change assert self.app.timezone.zone to assert self.app.timezone.key #664

Merged
merged 6 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions django_celery_beat/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ class ClockedScheduleAdmin(admin.ModelAdmin):


class CrontabScheduleAdmin(admin.ModelAdmin):
"""Admin class for CrontabSchedule."""

list_display = ('__str__', 'human_readable')


Expand Down
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@
),
},
))

intersphinx_mapping = globals().get('intersphinx_mapping', {})
intersphinx_mapping['celery'] = (
'https://celery.readthedocs.io/en/main/', None)
globals().update({'intersphinx_mapping': intersphinx_mapping})
6 changes: 3 additions & 3 deletions t/unit/test_schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def test_entry_is_due__no_use_tz(self):
os.environ["TZ"] = "Europe/Berlin"
if hasattr(time, "tzset"):
time.tzset()
assert self.app.timezone.zone == 'Europe/Berlin'
assert self.app.timezone.key == 'Europe/Berlin'

# simulate last_run_at from DB - not TZ aware but localtime
right_now = datetime.utcnow()
Expand Down Expand Up @@ -191,7 +191,7 @@ def test_entry_and_model_last_run_at_with_utc_no_use_tz(self, monkeypatch):
os.environ["TZ"] = "Europe/Berlin"
if hasattr(time, "tzset"):
time.tzset()
assert self.app.timezone.zone == 'Europe/Berlin'
assert self.app.timezone.key == 'Europe/Berlin'
# simulate last_run_at from DB - not TZ aware but localtime
right_now = datetime.utcnow()
# make sure to use fixed date time
Expand Down Expand Up @@ -227,7 +227,7 @@ def test_entry_is_due__celery_timezone_doesnt_match_time_zone(self):
os.environ["TZ"] = "Europe/Berlin"
if hasattr(time, "tzset"):
time.tzset()
assert self.app.timezone.zone == 'America/New_York'
assert self.app.timezone.key == 'America/New_York'

# simulate last_run_at all none, doing the same thing that
# _default_now() would do
Expand Down