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
a6e57223
Commit
a6e57223
authored
Dec 06, 2019
by
Muhammad Fakhrillah Abdul Azis
Browse files
Merge branch '1606917531-210' into 'master'
1606917531 210 See merge request
!276
parents
fb94ea22
4f962ca0
Pipeline
#26840
passed with stages
in 8 minutes and 32 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
core/tests/test_accounts.py
View file @
a6e57223
...
...
@@ -6,7 +6,8 @@ from django.core.exceptions import ValidationError
from
rest_framework
import
status
from
rest_framework.test
import
APITestCase
from
core.views.sso_login
import
get_access_token
,
get_riwayat_user
from
django.core
import
serializers
from
core.models.accounts
import
Student
try
:
from
StringIO
import
StringIO
## for Python 2
...
...
@@ -581,6 +582,30 @@ class ResponseApiLoginCompany(APITestCase):
self
.
assertTrue
(
"last_login"
in
response
.
data
.
keys
())
class
TranscriptTest
(
APITestCase
):
# Belum bisa diimplementasikan karena untuk melihat transcript akun yang digunakan harus tercatat pada service API SSO.
# Implementasi fitur ini menggunakan access token yang langsung diambil dari API SSO.
'''
@requests_mock.Mocker()
def test_transcript_success(self, m):
mock_csui_oauth_verify(m)
mock_csui_ldap_student(m)
mock_csui_siak_student(m)
url = '/api/login/'
response = self.client.post(url, {'username': 'dummy.mahasiswa', 'password': 'lalala', 'login-type': 'sso-ui'},
format='json')
student_id = response.data.get('student').get('id')
student = Student.objects.all()
student.update(show_transcript=True)
url = '/api/students/' + str(student_id) + "/transcript/"
response = self.client.get(url)
self.fail()
'''
@
requests_mock
.
Mocker
()
def
test_transcript_fail
(
self
,
m
):
...
...
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