Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
cf25c39e
Commit
cf25c39e
authored
Apr 09, 2017
by
Joshua Casey
Browse files
revised test
parent
5c921954
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/tests/test_vacancies.py
View file @
cf25c39e
...
...
@@ -24,7 +24,7 @@ class ApplicationTests(APITestCase):
response
=
self
.
client
.
post
(
url
,
{
'username'
:
'dummy.mahasiswa'
,
'password'
:
'lalala'
,
'login-type'
:
'sso-ui'
},
format
=
'json'
)
student_id
=
response
.
data
.
get
(
'student'
).
get
(
'id'
)
url
=
'/api/students/'
+
str
(
student_id
)
+
'/appli
cation
s/'
url
=
'/api/students/'
+
str
(
student_id
)
+
'/appli
ed-vacancie
s/'
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
...
...
@@ -51,11 +51,11 @@ class ApplicationTests(APITestCase):
new_company
=
Company
.
objects
.
create
(
user
=
new_user
,
description
=
"lalala"
,
verified
=
True
,
logo
=
None
,
address
=
None
)
new_vacancy
=
Vacancy
.
objects
.
create
(
company
=
new_company
,
verified
=
True
,
open_time
=
datetime
.
fromtimestamp
(
0
),
description
=
"lalala"
,
close_time
=
datetime
.
today
())
url
=
'/api/students/'
+
str
(
student_id
)
+
'/appli
cation
s/'
url
=
'/api/students/'
+
str
(
student_id
)
+
'/appli
ed-vacancie
s/'
response
=
self
.
client
.
post
(
url
,
{
'vacancy_id'
:
new_vacancy
.
pk
,
'cover_letter'
:
'this is a cover letter.'
},
format
=
'json'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
url
=
'/api/students/'
+
str
(
student_id
)
+
'/appli
cation
s/'
+
str
(
new_vacancy
.
pk
)
+
'/'
url
=
'/api/students/'
+
str
(
student_id
)
+
'/appli
ed-vacancie
s/'
+
str
(
new_vacancy
.
pk
)
+
'/'
response
=
self
.
client
.
delete
(
url
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment