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
e77919da
Commit
e77919da
authored
4 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
sorry for this. a print to debug the tests. can't run them locally
parent
1bf67329
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!268
Resolve "Permission and button to unfinish visit or to add appointment."
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/tests/view/test_visit.py
+5
-0
5 additions, 0 deletions
smash/web/tests/view/test_visit.py
with
5 additions
and
0 deletions
smash/web/tests/view/test_visit.py
+
5
−
0
View file @
e77919da
...
...
@@ -115,6 +115,7 @@ class VisitViewTests(LoggedInTestCase):
response
=
self
.
client
.
get
(
reverse
(
'
web.views.visit_unfinish
'
,
args
=
[
visit
.
id
]),
follow
=
True
)
messages
=
list
(
get_messages
(
response
.
wsgi_request
))
print
(
'
Messages:
'
,
messages
)
self
.
assertEqual
(
len
(
messages
),
1
)
self
.
assertEqual
(
str
(
messages
[
0
]),
'
You are not authorized to view this page or perform this action. Request permissions to the system administrator.
'
)
new_visit
=
Visit
.
objects
.
get
(
id
=
visit
.
id
)
...
...
@@ -136,6 +137,7 @@ class VisitViewTests(LoggedInTestCase):
response
=
self
.
client
.
get
(
reverse
(
'
web.views.visit_unfinish
'
,
args
=
[
visit
.
id
]),
follow
=
True
)
messages
=
list
(
get_messages
(
response
.
wsgi_request
))
print
(
'
Messages:
'
,
messages
)
self
.
assertEqual
(
len
(
messages
),
1
)
self
.
assertEqual
(
str
(
messages
[
0
]),
'
Visit has been unfinished.
'
)
new_visit
=
Visit
.
objects
.
get
(
id
=
visit
.
id
)
...
...
@@ -159,6 +161,7 @@ class VisitViewTests(LoggedInTestCase):
response
=
self
.
client
.
get
(
reverse
(
'
web.views.visit_unfinish
'
,
args
=
[
visit
.
id
]),
follow
=
True
)
messages
=
list
(
get_messages
(
response
.
wsgi_request
))
print
(
'
Messages:
'
,
messages
)
self
.
assertEqual
(
len
(
messages
),
1
)
self
.
assertEqual
(
str
(
messages
[
0
]),
"
Visit can
'
t be unfinished. The next visit has appointments.
"
)
original_visit
=
Visit
.
objects
.
get
(
id
=
visit
.
id
)
...
...
@@ -185,6 +188,7 @@ class VisitViewTests(LoggedInTestCase):
#try to unfinish the original visit
response
=
self
.
client
.
get
(
reverse
(
'
web.views.visit_unfinish
'
,
args
=
[
visit
.
id
]),
follow
=
True
)
messages
=
list
(
get_messages
(
response
.
wsgi_request
))
print
(
'
Messages:
'
,
messages
)
self
.
assertEqual
(
len
(
messages
),
1
)
self
.
assertEqual
(
str
(
messages
[
0
]),
"
Visit can
'
t be unfinished. Only visits with one inmediate future visit (without appointments) can be unfinished.
"
)
self
.
assertEqual
(
3
,
Visit
.
objects
.
count
())
...
...
@@ -199,6 +203,7 @@ class VisitViewTests(LoggedInTestCase):
response
=
self
.
client
.
get
(
reverse
(
'
web.views.visit_unfinish
'
,
args
=
[
visit
.
id
]),
follow
=
True
)
messages
=
list
(
get_messages
(
response
.
wsgi_request
))
print
(
'
Messages:
'
,
messages
)
self
.
assertEqual
(
len
(
messages
),
1
)
self
.
assertEqual
(
str
(
messages
[
0
]),
"
The visit is not finished.
"
)
...
...
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