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
04b79bd1
Commit
04b79bd1
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
changed function variables to function attributes
parent
c7625a5d
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
+11
-6
11 additions, 6 deletions
smash/web/tests/functions.py
with
11 additions
and
6 deletions
smash/web/tests/functions.py
+
11
−
6
View file @
04b79bd1
...
@@ -248,13 +248,18 @@ def create_voucher_partner():
...
@@ -248,13 +248,18 @@ def create_voucher_partner():
return
worker
return
worker
def
create_availability
(
worker
=
None
):
def
create_availability
(
worker
=
None
,
available_from
=
None
,
available_till
=
None
,
day_number
=
MONDAY_AS_DAY_OF_WEEK
):
if
available_from
is
None
:
available_from
=
'
8:00
'
if
available_till
is
None
:
available_till
=
'
18:00
'
if
worker
is
None
:
if
worker
is
None
:
worker
=
create_worker
()
worker
=
create_worker
()
availability
=
Availability
.
objects
.
create
(
person
=
worker
,
availability
=
Availability
.
objects
.
create
(
person
=
worker
,
day_number
=
MONDAY_AS_DAY_OF_WEEK
,
day_number
=
day_number
,
available_from
=
get_today_midnight_date
()
,
available_from
=
available_from
,
available_till
=
get_today_midnight_date
()
,
available_till
=
available_till
,
)
)
return
availability
return
availability
...
@@ -268,14 +273,14 @@ def create_visit(subject=None):
...
@@ -268,14 +273,14 @@ def create_visit(subject=None):
is_finished
=
False
)
is_finished
=
False
)
def
create_appointment
(
visit
=
None
,
when
=
None
):
def
create_appointment
(
visit
=
None
,
when
=
None
,
length
=
30
):
if
visit
is
None
:
if
visit
is
None
:
visit
=
create_visit
()
visit
=
create_visit
()
# if when is None:
# if when is None:
# when = get_today_midnight_date()
# when = get_today_midnight_date()
return
Appointment
.
objects
.
create
(
return
Appointment
.
objects
.
create
(
visit
=
visit
,
visit
=
visit
,
length
=
30
,
length
=
length
,
location
=
get_test_location
(),
location
=
get_test_location
(),
status
=
Appointment
.
APPOINTMENT_STATUS_SCHEDULED
,
status
=
Appointment
.
APPOINTMENT_STATUS_SCHEDULED
,
datetime_when
=
when
)
datetime_when
=
when
)
...
...
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