Skip to content
Snippets Groups Projects
Commit 5f7f87bc authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

fix: 2to3 removed unnecessary conversion

parent 4c0202ce
No related branches found
No related tags found
1 merge request!261Python3 translation
......@@ -331,8 +331,6 @@ def create_appointment(visit=None, when=None, length=30):
def create_appointment_without_visit(when=None, length=30):
if not is_aware(when):
when = make_aware(when)
return Appointment.objects.create(
length=length,
location=get_test_location(),
......
......@@ -173,8 +173,9 @@ class ViewFunctionsTests(LoggedInTestCase):
appointment.save()
AppointmentTypeLink.objects.create(
appointment=appointment, appointment_type=appointment_type)
start_date = get_today_midnight_date().strftime("%Y-%m-%d")
response = self.client.get(reverse('web.views.kit_requests_send_mail',
kwargs={'start_date': str(get_today_midnight_date().strftime("%Y-%m-%d"))}))
kwargs={'start_date': start_date}))
self.assertEqual(response.status_code, 200)
self.assertTrue(item_name.encode('utf8') in response.content)
self.assertEqual(1, len(mail.outbox))
......@@ -36,15 +36,14 @@ def get_kit_requests(user, start_date=None, end_date=None):
start_date = get_today_midnight_date() + datetime.timedelta(days=1)
end_date = start_date + datetime.timedelta(days=days)
else:
if isinstance(start_date, str):
start_date = parse_datetime(start_date)
if isinstance(start_date, str):
start_date = datetime.datetime.strptime(start_date, '%Y-%m-%d')
if (end_date is not None) and (isinstance(end_date, str)):
end_date = parse_datetime(end_date)
if (end_date is not None) and (isinstance(end_date, str)):
end_date = datetime.datetime.strptime(end_date, '%Y-%m-%d')
if start_date is None:
raise ValueError("start_date must not be None")
appointment_types = AppointmentType.objects.filter(
required_equipment__disposable=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment