Skip to content

Commit

Permalink
Fix CI: Change assert self.app.timezone.zone to assert self.app.timez…
Browse files Browse the repository at this point in the history
…one.key (#664)

* Change
assert self.app.timezone.zone  to assert self.app.timezone.key

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>

* Add docstring to fix pydocstyle

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>

* Add blank line (PEP 257)

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>

* Update docs/conf.py

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>

* Add blank line

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>

* Fix
docs/conf.py:43:80: E501 line too long (80 > 79 characters)

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>

---------

Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>
  • Loading branch information
stasfilin authored Jul 16, 2023
1 parent b47da32 commit 90b27d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
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

0 comments on commit 90b27d2

Please sign in to comment.