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
3059b600
There was a problem fetching the pipeline mini graph.
Commit
3059b600
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
unit tests added
parent
76f774cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!138
list of vouchers with possibility to filter and sort
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/tests/api_views/test_voucher.py
+8
-0
8 additions, 0 deletions
smash/web/tests/api_views/test_voucher.py
smash/web/tests/api_views/test_worker.py
+9
-1
9 additions, 1 deletion
smash/web/tests/api_views/test_worker.py
with
17 additions
and
1 deletion
smash/web/tests/api_views/test_voucher.py
+
8
−
0
View file @
3059b600
# coding=utf-8
import
datetime
import
json
import
logging
from
django.urls
import
reverse
...
...
@@ -194,3 +195,10 @@ class TestVoucherApi(LoggedInWithWorkerTestCase):
voucher
=
self
.
voucher
self
.
check_voucher_filtered
([[
""
,
"
X
"
]],
[
voucher
])
def
test_get_columns
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'
web.api.vouchers.columns
'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
columns
=
json
.
loads
(
response
.
content
)[
'
columns
'
]
self
.
assertTrue
(
len
(
columns
)
>
0
)
This diff is collapsed.
Click to expand it.
smash/web/tests/api_views/test_worker.py
+
9
−
1
View file @
3059b600
...
...
@@ -4,10 +4,12 @@ import json
from
django.test
import
RequestFactory
from
django.urls
import
reverse
from
web.api_views.worker
import
availabilities
from
web.models
import
Availability
from
web.models.constants
import
TUESDAY_AS_DAY_OF_WEEK
from
web.
api_views.worker
import
availabilities
from
web.
models.worker_study_role
import
WORKER_STAFF
from
web.tests
import
LoggedInWithWorkerTestCase
from
web.tests.functions
import
create_voucher_partner
class
TestWorkerApi
(
LoggedInWithWorkerTestCase
):
...
...
@@ -52,6 +54,12 @@ class TestWorkerApi(LoggedInWithWorkerTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTrue
(
self
.
worker
.
first_name
in
response
.
content
)
def
test_voucher_partners
(
self
):
voucher_partner
=
create_voucher_partner
()
response
=
self
.
client
.
get
(
reverse
(
'
web.api.workers
'
,
kwargs
=
{
'
worker_role
'
:
WORKER_STAFF
}))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTrue
(
voucher_partner
.
first_name
in
response
.
content
)
def
test_empty_availabilities
(
self
):
factory
=
RequestFactory
()
request
=
factory
.
get
(
'
/api/workers?start_date=2017-10-20&end_date=2017-11-20
'
)
...
...
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