Skip to content
Snippets Groups Projects
Commit ccef9140 authored by Carlos Vega's avatar Carlos Vega
Browse files

adapted some functions to be useful with the test_office_availability

parent 4c46d010
No related branches found
No related tags found
1 merge request!171Feature/daily availability
......@@ -154,13 +154,13 @@ def get_test_study():
return create_study("test-study")
def create_appointment_type():
def create_appointment_type(code='C', default_duration=10, description='test'):
return AppointmentType.objects.create(
code="C",
default_duration="10",
description="test",
code=code,
default_duration=default_duration,
description=description,
)
def create_contact_attempt(subject=None, worker=None):
if subject is None:
......@@ -264,11 +264,15 @@ def create_availability(worker=None, available_from=None, available_till=None, d
return availability
def create_visit(subject=None):
def create_visit(subject=None, datetime_begin=None, datetime_end=None):
if subject is None:
subject = create_study_subject()
return Visit.objects.create(datetime_begin=get_today_midnight_date() + datetime.timedelta(days=-31),
datetime_end=get_today_midnight_date() + datetime.timedelta(days=31),
if datetime_begin is None:
datetime_begin = get_today_midnight_date() + datetime.timedelta(days=-31)
if datetime_end is None:
datetime_end = get_today_midnight_date() + datetime.timedelta(days=31)
return Visit.objects.create(datetime_begin=datetime_begin,
datetime_end=datetime_end,
subject=subject,
is_finished=False)
......
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