-
Notifications
You must be signed in to change notification settings - Fork 430
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
A unit Test to make sure ClockedSchedule and PeriodicTasks are shown in TimeZone format #485
Conversation
@auvipy Here is the unit test |
t/unit/test_models.py
Outdated
"""Make sure the scheduled time is not shown in UTC when time zone is used""" | ||
tz_info = pytz.timezone(settings.TIME_ZONE).localize(datetime.datetime.utcnow()) | ||
schedule, created = ClockedSchedule.objects.get_or_create(clocked_time=tz_info) | ||
self.assertEquals(str(schedule.clocked_time), str(schedule)) # testnig str(schedule) calls make_aware() internally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also assert should be in pytest style for any celery project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@auvipy
when I run pytest
I get 97 errors, although when I run pytest --fixtures
it says collected 97 items.
any cluses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get:
fixture 'patching' not found
file \django-celery-beat\t\unit\conftest.py, line 29
@pytest.fixture(autouse=True)
def test_cases_shortcuts(request, app, patching):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the assert and pushed a commit.
Please let me know if you need anything.
Also, please let me know how to pytest it without errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use any linter for the style issues
a7ab941
to
ff72ba9
Compare
…owing UTC time when Time Zone is used
were you able to run test locally? |
fixture 'patching' not found if you can help please let me know. |
please wait untill i make the CI work. i might need to push to your branch as well |
Hi @auvipy |
I have started CI to test this properly |
v 2.3.0 of beat segfaults in our cloudfoundry env, with an error that suggests that this unit test is failing.
|
can you work on a fix? |
This is a unit test for merged pull request #464