Fakultas Ilmu Komputer UI

Commit 5227d6ab authored by Claudio Yosafat's avatar Claudio Yosafat
Browse files

Create test for submit skills only number and empty

parent bc54b300
Pipeline #25209 failed with stages
in 8 minutes and 54 seconds
...@@ -254,6 +254,15 @@ class ProfileUpdateTests(APITestCase): ...@@ -254,6 +254,15 @@ class ProfileUpdateTests(APITestCase):
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED) self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('interests'), 'Machine Learning') self.assertEqual(response.data.get('interests'), 'Machine Learning')
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'skills': ''}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('skills'), '')
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'skills': '1231231231'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
@requests_mock.Mocker() @requests_mock.Mocker()
def test_student_profile_update_filetype_validation(self, m): def test_student_profile_update_filetype_validation(self, m):
mock_csui_oauth_verify(m) mock_csui_oauth_verify(m)
......
Supports Markdown
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