Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
4f962ca0
Commit
4f962ca0
authored
Dec 06, 2019
by
Muhammad Fakhrillah Abdul Azis
Browse files
Merge branch 'master' into '1606917531-210'
# Conflicts: # core/tests/test_accounts.py
parent
fb94ea22
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/tests/test_accounts.py
View file @
4f962ca0
...
...
@@ -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
.
Attach a 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