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
746edd42
Commit
746edd42
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
fixed tests for
#294
parent
04aa130c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!206
Improvement/interface changes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/tests/view/test_appointments.py
+33
-4
33 additions, 4 deletions
smash/web/tests/view/test_appointments.py
with
33 additions
and
4 deletions
smash/web/tests/view/test_appointments.py
+
33
−
4
View file @
746edd42
...
...
@@ -137,7 +137,7 @@ class AppointmentsViewTests(LoggedInTestCase):
self
.
assertEqual
(
Appointment
.
APPOINTMENT_STATUS_FINISHED
,
appointment_result
.
status
)
def
test_save_appointments_edit_with_invalid_nd_number
(
self
):
subject
=
create_study_subject
(
nd_number
=
None
)
subject
=
create_study_subject
(
nd_number
=
'
DUMB_ND_NUMBER
'
)
visit
=
create_visit
(
subject
)
appointment
=
create_appointment
(
visit
,
get_today_midnight_date
())
...
...
@@ -239,13 +239,42 @@ class AppointmentsViewTests(LoggedInTestCase):
appointment
.
visit
=
None
appointment
.
save
()
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
appointment_id
'
:
appointment
.
id
}))
#without permission
self
.
login_as_staff
()
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
pk
'
:
appointment
.
id
}))
self
.
assertEqual
(
1
,
Appointment
.
objects
.
all
().
count
())
#with permission
self
.
login_as_super
()
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
pk
'
:
appointment
.
id
}))
self
.
assertEqual
(
0
,
Appointment
.
objects
.
all
().
count
())
def
test_delete_invalid_appointment_with_visit
(
self
):
def
test_delete_appointment_with_visit
(
self
):
self
.
login_as_super
()
appointment
=
create_appointment
()
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
appointment_id
'
:
appointment
.
id
}))
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
pk
'
:
appointment
.
id
}))
self
.
assertEqual
(
0
,
Appointment
.
objects
.
all
().
count
())
def
test_delete_invalid_finished_appointment
(
self
):
self
.
login_as_super
()
appointment
=
create_appointment
()
appointment
.
status
=
Appointment
.
APPOINTMENT_STATUS_FINISHED
appointment
.
visit
=
None
appointment
.
save
()
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
pk
'
:
appointment
.
id
}))
self
.
assertEqual
(
1
,
Appointment
.
objects
.
all
().
count
())
def
test_delete_invalid_finished_appointment_with_visit
(
self
):
self
.
login_as_super
()
appointment
=
create_appointment
()
appointment
.
status
=
Appointment
.
APPOINTMENT_STATUS_FINISHED
appointment
.
save
()
self
.
client
.
post
(
reverse
(
'
web.views.appointment_delete
'
,
kwargs
=
{
'
pk
'
:
appointment
.
id
}))
self
.
assertEqual
(
1
,
Appointment
.
objects
.
all
().
count
())
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