|
1 | | -from datetime import datetime, timezone |
| 1 | +from datetime import UTC, datetime |
2 | 2 | from itertools import cycle |
3 | 3 |
|
4 | 4 | from faker import Faker |
@@ -42,17 +42,17 @@ def generate_data(user, image_category, post_categories): |
42 | 42 | slug = slugify(title) + f"-{fake.pyint(10, 99999)}" |
43 | 43 | publish_at = ( |
44 | 44 | fake.date_time_between_dates( |
45 | | - datetime_start=datetime(2020, 1, 1, tzinfo=timezone.utc), |
46 | | - datetime_end=datetime(2022, 10, 12, tzinfo=timezone.utc), |
47 | | - tzinfo=timezone.utc, |
| 45 | + datetime_start=datetime(2020, 1, 1, tzinfo=UTC), |
| 46 | + datetime_end=datetime(2022, 10, 12, tzinfo=UTC), |
| 47 | + tzinfo=UTC, |
48 | 48 | ) |
49 | 49 | if fake.pybool() |
50 | 50 | else None |
51 | 51 | ) |
52 | 52 | created = fake.date_time_between_dates( |
53 | | - datetime_start=datetime(2020, 1, 1, tzinfo=timezone.utc), |
54 | | - datetime_end=datetime(2022, 10, 12, tzinfo=timezone.utc), |
55 | | - tzinfo=timezone.utc, |
| 53 | + datetime_start=datetime(2020, 1, 1, tzinfo=UTC), |
| 54 | + datetime_end=datetime(2022, 10, 12, tzinfo=UTC), |
| 55 | + tzinfo=UTC, |
56 | 56 | ) |
57 | 57 | if publish_at and publish_at < created: |
58 | 58 | created = publish_at |
@@ -89,17 +89,17 @@ def generate_data(user, image_category, post_categories): |
89 | 89 | slug = slugify(title) + f"-{fake.pyint(10, 9999)}" |
90 | 90 | publish_at = ( |
91 | 91 | fake.date_time_between_dates( |
92 | | - datetime_start=datetime(2020, 1, 1, tzinfo=timezone.utc), |
93 | | - datetime_end=datetime(2022, 10, 12, tzinfo=timezone.utc), |
94 | | - tzinfo=timezone.utc, |
| 92 | + datetime_start=datetime(2020, 1, 1, tzinfo=UTC), |
| 93 | + datetime_end=datetime(2022, 10, 12, tzinfo=UTC), |
| 94 | + tzinfo=UTC, |
95 | 95 | ) |
96 | 96 | if fake.pybool() |
97 | 97 | else None |
98 | 98 | ) |
99 | 99 | created = fake.date_time_between_dates( |
100 | | - datetime_start=datetime(2020, 1, 1, tzinfo=timezone.utc), |
101 | | - datetime_end=datetime(2022, 10, 12, tzinfo=timezone.utc), |
102 | | - tzinfo=timezone.utc, |
| 100 | + datetime_start=datetime(2020, 1, 1, tzinfo=UTC), |
| 101 | + datetime_end=datetime(2022, 10, 12, tzinfo=UTC), |
| 102 | + tzinfo=UTC, |
103 | 103 | ) |
104 | 104 | if publish_at and publish_at < created: |
105 | 105 | created = publish_at |
|
0 commit comments