Fakultas Ilmu Komputer UI

Commit 15d885c6 authored by fakhrilm's avatar fakhrilm
Browse files

membuat template test transcript success

parent 08f6be23
Pipeline #26825 passed with stages
in 9 minutes and 27 seconds
......@@ -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
......@@ -511,6 +512,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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment