Fakultas Ilmu Komputer UI

Commit 0bcc2cf8 authored by JONATHAN EDWIN's avatar JONATHAN EDWIN
Browse files

Merge branch '1606891500-233' into 'master'

1606891500 233

See merge request !277
parents a57e5d7f fb9b3535
Pipeline #26830 passed with stages
in 30 minutes and 15 seconds
File added
# Generated by Django 2.2.8 on 2019-12-06 08:57
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='student',
name='region',
field=models.CharField(blank=True, max_length=30, null=True, validators=[django.core.validators.RegexValidator('^\\w{0,30}$')]),
),
]
# Generated by Django 2.2.8 on 2019-12-06 09:00
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20191206_1557'),
]
operations = [
migrations.AlterField(
model_name='student',
name='region',
field=models.CharField(blank=True, max_length=30, null=True, validators=[django.core.validators.RegexValidator('^[A-Za-z]+$')]),
),
]
......@@ -101,7 +101,7 @@ class Student(models.Model):
hackerrank_url = models.URLField(max_length=200, blank=True, null=True)
website_url = models.URLField(max_length=200, blank=True, null=True)
work_experience = models.CharField(max_length=500, blank=True, null=True)
region = models.CharField(max_length=30, blank=True, null=True)
region = models.CharField(max_length=30, blank=True, null=True, validators=[RegexValidator(r'^[A-Za-z]+$')])
alamat = models.CharField(max_length=50, blank=True, null=True)
skills = models.CharField(max_length=50, blank=True, null=True)
recommendations = models.ManyToManyField('core.Recommendation', related_name="recommendations", blank=True)
......
......@@ -228,6 +228,11 @@ class ProfileUpdateTests(APITestCase):
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertEqual(response.data.get('region'), 'Indonesia')
response = self.client.patch(url, {'region': '12345'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
url = '/api/students/' + str(student_id) + "/profile/"
response = self.client.patch(url, {'gender': 'Perempuan'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
......@@ -487,9 +492,11 @@ class ProfileUpdateTests(APITestCase):
Company.objects.create(user=new_user, description="lalalala", status=Company.VERIFIED, logo=None, address=None)
url = '/api/login/'
response = self.client.post(url, {'username': 'dummy.login.company', 'password': 'lalala123',
'login-type': 'company'},
format='json')
company_id = response.data.get('company').get('id')
url = '/api/companies/' + str(company_id) + "/profile/"
......
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