Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
ccef9140
Commit
ccef9140
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
adapted some functions to be useful with the test_office_availability
parent
4c46d010
No related branches found
No related tags found
1 merge request
!171
Feature/daily availability
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/tests/functions.py
+12
-8
12 additions, 8 deletions
smash/web/tests/functions.py
with
12 additions
and
8 deletions
smash/web/tests/functions.py
+
12
−
8
View file @
ccef9140
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment