Commit c4def62d9e882848624d2ab35b08cf46925e7ab3

Authored by kosaniak
1 parent 8bc8431a

Add astimezone to initial_data

... ... @@ -9,7 +9,7 @@ from faker.providers.company.en_US import Provider as CompanyProviderEnUs
9 9 from faker.providers.company.ru_RU import Provider as CompanyProviderRuRu
10 10 from munch import munchify
11 11 from op_faker import OP_Provider
12   -from .local_time import get_now
  12 +from .local_time import get_now, TZ
13 13
14 14
15 15 fake_en = Factory.create(locale='en_US')
... ... @@ -99,7 +99,7 @@ def test_tender_data(params,
99 99 period_dict[period_name + "Period"] = {}
100 100 for i, j in zip(range(2), ("start", "end")):
101 101 inc_dt += timedelta(minutes=params['intervals'][period_name][i])
102   - period_dict[period_name + "Period"][j + "Date"] = inc_dt.isoformat()
  102 + period_dict[period_name + "Period"][j + "Date"] = inc_dt.astimezone(TZ).isoformat()
103 103 data.update(period_dict)
104 104 cpv_group = fake.cpv()[:4]
105 105 if params.get('number_of_lots'):
... ... @@ -319,8 +319,8 @@ def test_item_data(cpv=None):
319 319 data["description_ru"] = field_with_id("i", data["description_ru"])
320 320 days = fake.random_int(min=1, max=30)
321 321 data["deliveryDate"] = {
322   - "startDate": (get_now() + timedelta(days=days)).isoformat(),
323   - "endDate": (get_now() + timedelta(days=days)).isoformat()
  322 + "startDate": (get_now() + timedelta(days=days)).astimezone(TZ).isoformat(),
  323 + "endDate": (get_now() + timedelta(days=days)).astimezone(TZ).isoformat()
324 324 }
325 325 data["deliveryAddress"]["countryName_en"] = translate_country_en(data["deliveryAddress"]["countryName"])
326 326 data["deliveryAddress"]["countryName_ru"] = translate_country_ru(data["deliveryAddress"]["countryName"])
... ...
Please register or login to post a comment