Skip to content

Commit 18baec4

Browse files
M Umar KhanM Umar Khan
authored andcommitted
chore: fix pytz errors
1 parent 1f36b67 commit 18baec4

File tree

10 files changed

+10
-13
lines changed

10 files changed

+10
-13
lines changed

common/djangoapps/track/backends/tests/test_logger.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ def test_logger_backend(caplog):
3232
'time': '2012-05-01T07:27:01.000200+00:00',
3333
'date': '2012-05-07'
3434
}
35-
print('ola-- ', saved_events[0], unpacked_event)
3635
assert saved_events[0] == unpacked_event
3736
assert saved_events[1] == unpacked_event

common/djangoapps/util/date_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ def from_timestamp(timestamp):
9595
"""
9696
try:
9797
return datetime.fromtimestamp(int(timestamp), tz=ZoneInfo("UTC"))
98-
# replacing this depreciated 1099
99-
# return datetime.utcfromtimestamp(int(timestamp)).replace(tzinfo=ZoneInfo("UTC"))
10098
except (ValueError, TypeError):
10199
return None
102100

openedx/core/djangoapps/xblock/tests/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# In the case where the validating server is really skewed
4545
# from the generating server.
4646
({"validation_time_delta_s": 86400 * -5}, False),
47-
# Setting reference_time to 20 seconds after start of a 2 day time periodZoneInfo("UTC")
47+
# Setting reference_time to 20 seconds after start of a 2 day time period(UTC)
4848
# Demonstrating maximum possible validity period is just below 4 days
4949
# This passes because validation time is just below the cutoff point
5050
(
@@ -53,7 +53,7 @@
5353
},
5454
True,
5555
),
56-
# Setting reference_time to 20 seconds after start of a 2 day time periodZoneInfo("UTC")
56+
# Setting reference_time to 20 seconds after start of a 2 day time period(UTC)
5757
# Demonstrating maximum possible validity period is just below 4 days
5858
# This does not pass because validation time is just above the cutoff point
5959
(
@@ -62,7 +62,7 @@
6262
},
6363
False,
6464
),
65-
# Setting reference_time to 20 seconds before end of a 2 day time periodZoneInfo("UTC")
65+
# Setting reference_time to 20 seconds before end of a 2 day time period(UTC)
6666
# Demonstrating minimum possible validity period is just above 2 days
6767
# This passes because validation time is just below the cutoff point
6868
(

openedx/core/lib/tests/test_time_zone_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ def test_display_time_zone_ambiguous_after(self):
7474
Test to ensure get_display_time_zone() returns correct abbreviations and offsets
7575
during ambiguous time periods (e.g. when DST is about to start/end) after the change
7676
"""
77-
with freeze_time("2024-11-04 09:00:00"):
77+
with freeze_time("2015-11-01 09:00:00"):
7878
tz_info = self._display_time_zone_helper('America/Los_Angeles')
7979
self._assert_time_zone_info_equal(tz_info, 'America/Los Angeles', 'PST', '-0800')

openedx/features/content_type_gating/migrations/0002_auto_20181119_0959.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
1414
migrations.AlterField(
1515
model_name='contenttypegatingconfig',
1616
name='enabled_as_of',
17-
field=models.DateField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date ZoneInfo("UTC") will be affected.', null=True, verbose_name='Enabled As Of'),
17+
field=models.DateField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date (UTC) will be affected.', null=True, verbose_name='Enabled As Of'),
1818
),
1919
migrations.AlterField(
2020
model_name='contenttypegatingconfig',

openedx/features/content_type_gating/migrations/0003_auto_20181128_1407.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
1414
migrations.AlterField(
1515
model_name='contenttypegatingconfig',
1616
name='enabled_as_of',
17-
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date ZoneInfo("UTC") will be affected.', null=True, verbose_name='Enabled As Of'),
17+
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date (UTC) will be affected.', null=True, verbose_name='Enabled As Of'),
1818
),
1919
]

openedx/features/content_type_gating/migrations/0004_auto_20181128_1521.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
1414
migrations.AlterField(
1515
model_name='contenttypegatingconfig',
1616
name='enabled_as_of',
17-
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date and time ZoneInfo("UTC") will be affected.', null=True, verbose_name='Enabled As Of'),
17+
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date and time (UTC) will be affected.', null=True, verbose_name='Enabled As Of'),
1818
),
1919
]

openedx/features/course_duration_limits/migrations/0002_auto_20181119_0959.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
1414
migrations.AlterField(
1515
model_name='coursedurationlimitconfig',
1616
name='enabled_as_of',
17-
field=models.DateField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date ZoneInfo("UTC") will be affected.', null=True, verbose_name='Enabled As Of'),
17+
field=models.DateField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date (UTC) will be affected.', null=True, verbose_name='Enabled As Of'),
1818
),
1919
]

openedx/features/course_duration_limits/migrations/0003_auto_20181128_1407.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
1414
migrations.AlterField(
1515
model_name='coursedurationlimitconfig',
1616
name='enabled_as_of',
17-
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date ZoneInfo("UTC") will be affected.', null=True, verbose_name='Enabled As Of'),
17+
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date (UTC) will be affected.', null=True, verbose_name='Enabled As Of'),
1818
),
1919
]

openedx/features/course_duration_limits/migrations/0004_auto_20181128_1521.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
1414
migrations.AlterField(
1515
model_name='coursedurationlimitconfig',
1616
name='enabled_as_of',
17-
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date and time ZoneInfo("UTC") will be affected.', null=True, verbose_name='Enabled As Of'),
17+
field=models.DateTimeField(blank=True, default=None, help_text='If the configuration is Enabled, then all enrollments created after this date and time (UTC) will be affected.', null=True, verbose_name='Enabled As Of'),
1818
),
1919
]

0 commit comments

Comments
 (0)