From 534a739d21d428a826954b900628ac54021a9481 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sun, 6 Oct 2019 17:28:07 +0700 Subject: [PATCH 01/21] [RED] Add test for open time vacancy not before today --- core/tests/test_create_vacancies.py | 121 +++++++++++++++++++++++----- 1 file changed, 103 insertions(+), 18 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 9d8cd65..c4cdbf1 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -16,8 +16,10 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), - 'close_time': datetime.today(), 'name': 'new_vacancy', 'description': 'new_vacancy '}, format='json') + day = datetime.timedelta(days=1) + today = datetime.today() + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy '}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancies = Vacancy.objects.count() @@ -30,8 +32,11 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), - 'close_time': datetime.today(), 'name': 'new_vacancy', + + day = datetime.timedelta(days=1) + today = datetime.today() + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 10}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -59,8 +64,10 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), - 'close_time': datetime.today(), 'name': 'new_vacancy', + day = datetime.timedelta(days=1) + today = datetime.today() + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 'sepuluh'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -73,11 +80,14 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + day = datetime.timedelta(days=1) + today = datetime.today() + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today, + description="lalala", close_time= today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': today + day, 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -87,11 +97,14 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + day = datetime.timedelta(days=1) + today = datetime.today() + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': today + day, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -104,11 +117,14 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + day = datetime.timedelta(days=1) + today = datetime.today() + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time= today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.today(), 'close_time': datetime.fromtimestamp(0), + response = self.client.patch(url, {'open_time': today + day, 'close_time': today, 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -118,13 +134,82 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + day = datetime.timedelta(days=1) + today = datetime.today() + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time= today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': today + day, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() self.assertEqual(vacancy.amount, None) + + def test_create_vacancy_with_same_date_failed(self): + superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') + new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, + address=None) + self.client.force_authenticate(user=superuser) + + today = datetime.today() + + url = '/api/vacancies/' + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + + vacancies = Vacancy.objects.count() + self.assertEqual(vacancies,0) + + def test_update_vacancy_with_same_date_failed(self): + superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') + new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, + address=None) + self.client.force_authenticate(user=superuser) + + today = datetime.today() + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), + description="lalala", close_time=datetime.today(), name='new_company') + + url = '/api/vacancies/' + str(new_vacancy.pk) + '/' + response = self.client.patch(url, {'open_time': today, 'close_time': today, + 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + + def test_create_vacancy_with_the_date_before_today(self): + superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') + new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, + address=None) + self.client.force_authenticate(user=superuser) + + day = datetime.timedelta(days=1) + today = datetime.today() + + url = '/api/vacancies/' + response = self.client.post(url, {'company': new_company.pk, 'open_time': today - day, + 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + + vacancies = Vacancy.objects.count() + self.assertEqual(vacancies,0) + + def test_update_vacancy_with_the_day_before_today(self): + superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') + new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, + address=None) + self.client.force_authenticate(user=superuser) + + day = datetime.timedelta(days=1) + today = datetime.today() + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today - day, + description="lalala", close_time= today + day, name='new_company') + + url = '/api/vacancies/' + str(new_vacancy.pk) + '/' + response = self.client.patch(url, {'open_time': today - day, 'close_time': today + day, + 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) -- GitLab From c5dd45c6a7d607258350c6d4d641a5e732c581e1 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sun, 6 Oct 2019 17:29:05 +0700 Subject: [PATCH 02/21] [GREEN] Implement open time vacancy not before today --- core/views/vacancies.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/views/vacancies.py b/core/views/vacancies.py index f51cfd3..4f1bd8b 100644 --- a/core/views/vacancies.py +++ b/core/views/vacancies.py @@ -1,4 +1,7 @@ import requests + +from dateutil.parser import parse as parse_date +from django.utils import timezone from django.conf import settings from rest_framework import viewsets, status from rest_framework.decorators import detail_route @@ -57,7 +60,10 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): close_time = data['close_time'] name = data['name'] description = data['description'] - if close_time < open_time: + today_date = timezone.now() - timezone.timedelta(days=1) + if parse_date(open_time) < today_date: + raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') + elif close_time < open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan!') vacancy = Vacancy(company=company, open_time=open_time, close_time=close_time, name=name, description=description) if 'amount' in data: @@ -75,7 +81,10 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): close_time = data['close_time'] name = data['name'] description = data['description'] - if close_time < open_time: + today_date = timezone.now() - timezone.timedelta(days=1) + if parse_date(open_time) < today_date: + raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') + elif close_time < open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan!') vacancy.open_time = open_time vacancy.close_time = close_time -- GitLab From a5f9d9e4248987da800540c7b4e0082e511a641b Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Mon, 7 Oct 2019 12:31:21 +0700 Subject: [PATCH 03/21] Solve migrations conflict --- core/migrations/0015_merge_20191005_1951.py | 16 ++++++++++++++++ core/migrations/0017_merge_20191006_0146.py | 16 ++++++++++++++++ core/migrations/0020_merge_20191006_1456.py | 17 +++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 core/migrations/0015_merge_20191005_1951.py create mode 100644 core/migrations/0017_merge_20191006_0146.py create mode 100644 core/migrations/0020_merge_20191006_1456.py diff --git a/core/migrations/0015_merge_20191005_1951.py b/core/migrations/0015_merge_20191005_1951.py new file mode 100644 index 0000000..81ba3fd --- /dev/null +++ b/core/migrations/0015_merge_20191005_1951.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2019-10-05 12:51 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0014_feedback'), + ('core', '0014_company_category'), + ] + + operations = [ + ] diff --git a/core/migrations/0017_merge_20191006_0146.py b/core/migrations/0017_merge_20191006_0146.py new file mode 100644 index 0000000..e6dd3d9 --- /dev/null +++ b/core/migrations/0017_merge_20191006_0146.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2019-10-05 18:46 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0015_merge_20191005_1951'), + ('core', '0016_merge_20191005_2235'), + ] + + operations = [ + ] diff --git a/core/migrations/0020_merge_20191006_1456.py b/core/migrations/0020_merge_20191006_1456.py new file mode 100644 index 0000000..3d0cb5d --- /dev/null +++ b/core/migrations/0020_merge_20191006_1456.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2019-10-06 07:56 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0017_vacancy_amount'), + ('core', '0019_merge_20191006_0852'), + ('core', '0017_merge_20191006_0146'), + ] + + operations = [ + ] -- GitLab From 325e3a6d117f9c6bf5c1ee55c64a8db286ee9a2d Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Mon, 7 Oct 2019 16:20:20 +0700 Subject: [PATCH 04/21] updat gilab ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 53ce629..0921767 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ test: - npm install - npm run build-production - pip install -r requirements.txt - - python manage.py makemigrations + - python manage.py makemigrations --merge - python manage.py migrate - python manage.py test - npm run karma -- GitLab From 364ebcea41eb607029ec1e678e700fb6524a7e63 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Mon, 7 Oct 2019 18:38:12 +0700 Subject: [PATCH 05/21] fix migration conflict --- .gitlab-ci.yml | 2 +- core/migrations/0023_merge_20191007_1837.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 core/migrations/0023_merge_20191007_1837.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0921767..53ce629 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ test: - npm install - npm run build-production - pip install -r requirements.txt - - python manage.py makemigrations --merge + - python manage.py makemigrations - python manage.py migrate - python manage.py test - npm run karma diff --git a/core/migrations/0023_merge_20191007_1837.py b/core/migrations/0023_merge_20191007_1837.py new file mode 100644 index 0000000..5125221 --- /dev/null +++ b/core/migrations/0023_merge_20191007_1837.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2019-10-07 11:37 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0022_merge_20191006_1851'), + ('core', '0020_merge_20191006_1456'), + ('core', '0021_vacancy_salary'), + ] + + operations = [ + ] -- GitLab From 407c47bc4f911b21a0f2feedaa3837cdf97d9c7f Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Mon, 7 Oct 2019 20:25:03 +0700 Subject: [PATCH 06/21] fix error --- core/migrations/0024_auto_20191007_2023.py | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 core/migrations/0024_auto_20191007_2023.py diff --git a/core/migrations/0024_auto_20191007_2023.py b/core/migrations/0024_auto_20191007_2023.py new file mode 100644 index 0000000..2b69354 --- /dev/null +++ b/core/migrations/0024_auto_20191007_2023.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2019-10-07 13:23 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0023_merge_20191007_1837'), + ] + + operations = [ + migrations.AddField( + model_name='company', + name='website', + field=models.CharField(default=b'Belum ada link website', max_length=100), + ), + migrations.AlterField( + model_name='student', + name='phone_number', + field=models.CharField(blank=True, db_index=True, max_length=12, null=True, validators=[django.core.validators.RegexValidator(b'^0\\d{1,11}$')]), + ), + ] -- GitLab From 90c4db2b3304bb880761939a603a208b0b817083 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Tue, 8 Oct 2019 16:09:26 +0700 Subject: [PATCH 07/21] reset migrations --- core/migrations/0001_initial.py | 92 ------------------- core/migrations/0002_auto_20170328_1131.py | 36 -------- core/migrations/0003_auto_20170328_1400.py | 33 ------- core/migrations/0004_auto_20170328_1417.py | 20 ---- core/migrations/0005_auto_20170328_1904.py | 43 --------- core/migrations/0006_auto_20170328_1950.py | 19 ---- core/migrations/0007_auto_20170424_0720.py | 40 -------- core/migrations/0007_auto_20170425_1550.py | 24 ----- core/migrations/0008_auto_20170424_0725.py | 25 ----- core/migrations/0009_auto_20170424_0909.py | 20 ---- core/migrations/0010_student_photo.py | 21 ----- core/migrations/0011_merge_20170425_2214.py | 16 ---- core/migrations/0012_auto_20170502_0925.py | 40 -------- core/migrations/0013_auto_20170602_1130.py | 32 ------- core/migrations/0014_auto_20191004_1340.py | 21 ----- core/migrations/0014_company_category.py | 20 ---- core/migrations/0014_feedback.py | 27 ------ core/migrations/0014_student_linkedin_url.py | 20 ---- core/migrations/0014_student_region.py | 20 ---- core/migrations/0014_vacancymilestone.py | 27 ------ core/migrations/0015_merge_20191005_1926.py | 16 ---- core/migrations/0015_merge_20191005_1951.py | 16 ---- core/migrations/0015_merge_20191005_1957.py | 17 ---- core/migrations/0015_merge_20191005_2038.py | 16 ---- core/migrations/0016_merge_20191005_2235.py | 16 ---- core/migrations/0016_merge_20191005_2256.py | 16 ---- core/migrations/0017_merge_20191006_0134.py | 16 ---- core/migrations/0017_merge_20191006_0146.py | 16 ---- core/migrations/0017_vacancy_amount.py | 20 ---- core/migrations/0018_merge_20191006_0603.py | 16 ---- core/migrations/0018_student_intro.py | 20 ---- .../0018_student_ui_ux_portofolio.py | 22 ----- core/migrations/0019_auto_20191006_0922.py | 25 ----- core/migrations/0019_merge_20191006_0852.py | 16 ---- core/migrations/0020_auto_20191006_1507.py | 25 ----- core/migrations/0020_merge_20191006_1406.py | 16 ---- core/migrations/0020_merge_20191006_1444.py | 16 ---- core/migrations/0020_merge_20191006_1456.py | 17 ---- core/migrations/0020_merge_20191006_1513.py | 17 ---- core/migrations/0020_merge_20191006_1558.py | 16 ---- core/migrations/0020_merge_20191006_1737.py | 17 ---- core/migrations/0020_merge_20191007_0648.py | 17 ---- core/migrations/0021_auto_20191006_1608.py | 20 ---- core/migrations/0021_auto_20191007_0648.py | 26 ------ core/migrations/0021_merge_20191006_1640.py | 16 ---- core/migrations/0021_vacancy_salary.py | 20 ---- core/migrations/0022_merge_20191006_1851.py | 18 ---- core/migrations/0023_merge_20191007_1533.py | 16 ---- core/migrations/0023_merge_20191007_1837.py | 17 ---- core/migrations/0024_auto_20191007_1533.py | 26 ------ core/migrations/0024_auto_20191007_2023.py | 26 ------ core/migrations/0025_merge_20191007_1810.py | 16 ---- core/migrations/0025_merge_20191007_2124.py | 16 ---- core/migrations/0025_merge_20191008_0014.py | 16 ---- core/migrations/0025_merge_20191008_0048.py | 16 ---- core/migrations/0026_merge_20191008_0256.py | 17 ---- core/migrations/0026_merge_20191008_0525.py | 17 ---- core/migrations/0027_merge_20191008_0646.py | 16 ---- core/migrations/0027_merge_20191008_0652.py | 16 ---- core/migrations/0028_merge_20191008_0843.py | 16 ---- core/migrations/0028_merge_20191008_0921.py | 16 ---- core/migrations/0029_merge_20191008_1146.py | 16 ---- 62 files changed, 1348 deletions(-) delete mode 100644 core/migrations/0001_initial.py delete mode 100644 core/migrations/0002_auto_20170328_1131.py delete mode 100644 core/migrations/0003_auto_20170328_1400.py delete mode 100644 core/migrations/0004_auto_20170328_1417.py delete mode 100644 core/migrations/0005_auto_20170328_1904.py delete mode 100644 core/migrations/0006_auto_20170328_1950.py delete mode 100644 core/migrations/0007_auto_20170424_0720.py delete mode 100644 core/migrations/0007_auto_20170425_1550.py delete mode 100644 core/migrations/0008_auto_20170424_0725.py delete mode 100644 core/migrations/0009_auto_20170424_0909.py delete mode 100644 core/migrations/0010_student_photo.py delete mode 100644 core/migrations/0011_merge_20170425_2214.py delete mode 100644 core/migrations/0012_auto_20170502_0925.py delete mode 100644 core/migrations/0013_auto_20170602_1130.py delete mode 100644 core/migrations/0014_auto_20191004_1340.py delete mode 100644 core/migrations/0014_company_category.py delete mode 100644 core/migrations/0014_feedback.py delete mode 100644 core/migrations/0014_student_linkedin_url.py delete mode 100644 core/migrations/0014_student_region.py delete mode 100644 core/migrations/0014_vacancymilestone.py delete mode 100644 core/migrations/0015_merge_20191005_1926.py delete mode 100644 core/migrations/0015_merge_20191005_1951.py delete mode 100644 core/migrations/0015_merge_20191005_1957.py delete mode 100644 core/migrations/0015_merge_20191005_2038.py delete mode 100644 core/migrations/0016_merge_20191005_2235.py delete mode 100644 core/migrations/0016_merge_20191005_2256.py delete mode 100644 core/migrations/0017_merge_20191006_0134.py delete mode 100644 core/migrations/0017_merge_20191006_0146.py delete mode 100644 core/migrations/0017_vacancy_amount.py delete mode 100644 core/migrations/0018_merge_20191006_0603.py delete mode 100644 core/migrations/0018_student_intro.py delete mode 100644 core/migrations/0018_student_ui_ux_portofolio.py delete mode 100644 core/migrations/0019_auto_20191006_0922.py delete mode 100644 core/migrations/0019_merge_20191006_0852.py delete mode 100644 core/migrations/0020_auto_20191006_1507.py delete mode 100644 core/migrations/0020_merge_20191006_1406.py delete mode 100644 core/migrations/0020_merge_20191006_1444.py delete mode 100644 core/migrations/0020_merge_20191006_1456.py delete mode 100644 core/migrations/0020_merge_20191006_1513.py delete mode 100644 core/migrations/0020_merge_20191006_1558.py delete mode 100644 core/migrations/0020_merge_20191006_1737.py delete mode 100644 core/migrations/0020_merge_20191007_0648.py delete mode 100644 core/migrations/0021_auto_20191006_1608.py delete mode 100644 core/migrations/0021_auto_20191007_0648.py delete mode 100644 core/migrations/0021_merge_20191006_1640.py delete mode 100644 core/migrations/0021_vacancy_salary.py delete mode 100644 core/migrations/0022_merge_20191006_1851.py delete mode 100644 core/migrations/0023_merge_20191007_1533.py delete mode 100644 core/migrations/0023_merge_20191007_1837.py delete mode 100644 core/migrations/0024_auto_20191007_1533.py delete mode 100644 core/migrations/0024_auto_20191007_2023.py delete mode 100644 core/migrations/0025_merge_20191007_1810.py delete mode 100644 core/migrations/0025_merge_20191007_2124.py delete mode 100644 core/migrations/0025_merge_20191008_0014.py delete mode 100644 core/migrations/0025_merge_20191008_0048.py delete mode 100644 core/migrations/0026_merge_20191008_0256.py delete mode 100644 core/migrations/0026_merge_20191008_0525.py delete mode 100644 core/migrations/0027_merge_20191008_0646.py delete mode 100644 core/migrations/0027_merge_20191008_0652.py delete mode 100644 core/migrations/0028_merge_20191008_0843.py delete mode 100644 core/migrations/0028_merge_20191008_0921.py delete mode 100644 core/migrations/0029_merge_20191008_1146.py diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py deleted file mode 100644 index adb92de..0000000 --- a/core/migrations/0001_initial.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-28 04:06 -from __future__ import unicode_literals - -import core.models.accounts -from django.conf import settings -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='Application', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ], - ), - migrations.CreateModel( - name='Company', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('description', models.TextField()), - ('verified', models.BooleanField(default=False)), - ('logo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_company_logo_file_path)), - ('alamat', models.CharField(blank=True, max_length=1000, null=True)), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Student', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('npm', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999)])), - ('resume', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_resume_file_path)), - ('phone_number', models.CharField(blank=True, db_index=True, max_length=100, null=True)), - ], - ), - migrations.CreateModel( - name='Supervisor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('nip', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999)])), - ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Vacancy', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('verified', models.BooleanField(default=False)), - ('open_time', models.DateTimeField()), - ('description', models.TextField(blank=True)), - ('close_time', models.DateTimeField()), - ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vacancies', to='core.Company')), - ], - ), - migrations.AddField( - model_name='student', - name='bookmarked_vacancies', - field=models.ManyToManyField(blank=True, to='core.Vacancy'), - ), - migrations.AddField( - model_name='student', - name='user', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='application', - name='student_npm', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.Student'), - ), - migrations.AddField( - model_name='application', - name='vacancy_id', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.Vacancy'), - ), - ] diff --git a/core/migrations/0002_auto_20170328_1131.py b/core/migrations/0002_auto_20170328_1131.py deleted file mode 100644 index 1b2481f..0000000 --- a/core/migrations/0002_auto_20170328_1131.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-28 04:31 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='application', - name='student_npm', - ), - migrations.RemoveField( - model_name='application', - name='vacancy_id', - ), - migrations.AddField( - model_name='student', - name='applied_vacancies', - field=models.ManyToManyField(blank=True, related_name='applied_vacancies', to='core.Vacancy'), - ), - migrations.AlterField( - model_name='student', - name='bookmarked_vacancies', - field=models.ManyToManyField(blank=True, related_name='bookmarked_vacancies', to='core.Vacancy'), - ), - migrations.DeleteModel( - name='Application', - ), - ] diff --git a/core/migrations/0003_auto_20170328_1400.py b/core/migrations/0003_auto_20170328_1400.py deleted file mode 100644 index 51e0a30..0000000 --- a/core/migrations/0003_auto_20170328_1400.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-28 07:00 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.utils.timezone - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0002_auto_20170328_1131'), - ] - - operations = [ - migrations.AddField( - model_name='vacancy', - name='created', - field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), - preserve_default=False, - ), - migrations.AddField( - model_name='vacancy', - name='name', - field=models.CharField(default=django.utils.timezone.now, max_length=100), - preserve_default=False, - ), - migrations.AddField( - model_name='vacancy', - name='updated', - field=models.DateTimeField(auto_now=True), - ), - ] diff --git a/core/migrations/0004_auto_20170328_1417.py b/core/migrations/0004_auto_20170328_1417.py deleted file mode 100644 index d0801ce..0000000 --- a/core/migrations/0004_auto_20170328_1417.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-28 07:17 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0003_auto_20170328_1400'), - ] - - operations = [ - migrations.RenameField( - model_name='company', - old_name='alamat', - new_name='address', - ), - ] diff --git a/core/migrations/0005_auto_20170328_1904.py b/core/migrations/0005_auto_20170328_1904.py deleted file mode 100644 index bde8129..0000000 --- a/core/migrations/0005_auto_20170328_1904.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-28 12:04 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0004_auto_20170328_1417'), - ] - - operations = [ - migrations.CreateModel( - name='Application', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('cover_letter', models.TextField(blank=True, null=True)), - ('allow_transcript', models.BooleanField(default=True)), - ], - ), - migrations.RemoveField( - model_name='student', - name='applied_vacancies', - ), - migrations.AddField( - model_name='student', - name='applied_vacancies', - field=models.ManyToManyField(blank=True, related_name='applied_vacancies', through='core.Application', to='core.Vacancy'), - ), - migrations.AddField( - model_name='application', - name='student', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Student'), - ), - migrations.AddField( - model_name='application', - name='vacancy', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Vacancy'), - ), - ] diff --git a/core/migrations/0006_auto_20170328_1950.py b/core/migrations/0006_auto_20170328_1950.py deleted file mode 100644 index 85ba09d..0000000 --- a/core/migrations/0006_auto_20170328_1950.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-28 12:50 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0005_auto_20170328_1904'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='application', - unique_together=set([('student', 'vacancy')]), - ), - ] diff --git a/core/migrations/0007_auto_20170424_0720.py b/core/migrations/0007_auto_20170424_0720.py deleted file mode 100644 index 23313a7..0000000 --- a/core/migrations/0007_auto_20170424_0720.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-04-24 07:20 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0006_auto_20170328_1950'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='batch', - field=models.CharField(blank=True, max_length=4, null=True), - ), - migrations.AddField( - model_name='student', - name='birth_date', - field=models.DateField(blank=True, null=True), - ), - migrations.AddField( - model_name='student', - name='birth_place', - field=models.TextField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='student', - name='major', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='student', - name='show_resume', - field=models.BooleanField(default=False), - ), - ] diff --git a/core/migrations/0007_auto_20170425_1550.py b/core/migrations/0007_auto_20170425_1550.py deleted file mode 100644 index ce925a3..0000000 --- a/core/migrations/0007_auto_20170425_1550.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-04-25 15:50 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0006_auto_20170328_1950'), - ] - - operations = [ - migrations.RemoveField( - model_name='application', - name='allow_transcript', - ), - migrations.AddField( - model_name='application', - name='status', - field=models.IntegerField(default=0), - ), - ] diff --git a/core/migrations/0008_auto_20170424_0725.py b/core/migrations/0008_auto_20170424_0725.py deleted file mode 100644 index bacc0eb..0000000 --- a/core/migrations/0008_auto_20170424_0725.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-04-24 07:25 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0007_auto_20170424_0720'), - ] - - operations = [ - migrations.AlterField( - model_name='student', - name='birth_place', - field=models.CharField(blank=True, max_length=30, null=True), - ), - migrations.AlterField( - model_name='student', - name='major', - field=models.CharField(blank=True, max_length=30, null=True), - ), - ] diff --git a/core/migrations/0009_auto_20170424_0909.py b/core/migrations/0009_auto_20170424_0909.py deleted file mode 100644 index 151a05c..0000000 --- a/core/migrations/0009_auto_20170424_0909.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-04-24 09:09 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0008_auto_20170424_0725'), - ] - - operations = [ - migrations.RenameField( - model_name='student', - old_name='show_resume', - new_name='show_transcript', - ), - ] diff --git a/core/migrations/0010_student_photo.py b/core/migrations/0010_student_photo.py deleted file mode 100644 index 2ed279a..0000000 --- a/core/migrations/0010_student_photo.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-04-24 13:34 -from __future__ import unicode_literals - -import core.models.accounts -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0009_auto_20170424_0909'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='photo', - field=models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_photo_file_path), - ), - ] diff --git a/core/migrations/0011_merge_20170425_2214.py b/core/migrations/0011_merge_20170425_2214.py deleted file mode 100644 index c255ca5..0000000 --- a/core/migrations/0011_merge_20170425_2214.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-04-25 22:14 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0010_student_photo'), - ('core', '0007_auto_20170425_1550'), - ] - - operations = [ - ] diff --git a/core/migrations/0012_auto_20170502_0925.py b/core/migrations/0012_auto_20170502_0925.py deleted file mode 100644 index 692e227..0000000 --- a/core/migrations/0012_auto_20170502_0925.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-05-02 02:25 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0011_merge_20170425_2214'), - ] - - operations = [ - migrations.AlterModelOptions( - name='company', - options={'ordering': ['-updated']}, - ), - migrations.AlterModelOptions( - name='student', - options={'ordering': ['-updated']}, - ), - migrations.AlterModelOptions( - name='supervisor', - options={'ordering': ['-updated']}, - ), - migrations.AlterModelOptions( - name='vacancy', - options={'ordering': ['-updated']}, - ), - migrations.RemoveField( - model_name='company', - name='verified', - ), - migrations.AddField( - model_name='company', - name='status', - field=models.IntegerField(default=0), - ), - ] diff --git a/core/migrations/0013_auto_20170602_1130.py b/core/migrations/0013_auto_20170602_1130.py deleted file mode 100644 index 4b30a1b..0000000 --- a/core/migrations/0013_auto_20170602_1130.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-06-02 04:30 -from __future__ import unicode_literals - -import core.lib.validators -import core.models.accounts -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0012_auto_20170502_0925'), - ] - - operations = [ - migrations.AlterField( - model_name='company', - name='logo', - field=models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_company_logo_file_path, validators=[core.lib.validators.validate_image_file_extension]), - ), - migrations.AlterField( - model_name='student', - name='photo', - field=models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_photo_file_path, validators=[core.lib.validators.validate_image_file_extension]), - ), - migrations.AlterField( - model_name='student', - name='resume', - field=models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_resume_file_path, validators=[core.lib.validators.validate_document_file_extension]), - ), - ] diff --git a/core/migrations/0014_auto_20191004_1340.py b/core/migrations/0014_auto_20191004_1340.py deleted file mode 100644 index fdff75b..0000000 --- a/core/migrations/0014_auto_20191004_1340.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-04 06:40 -from __future__ import unicode_literals - -import core.lib.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0013_auto_20170602_1130'), - ] - - operations = [ - migrations.AlterField( - model_name='student', - name='npm', - field=models.IntegerField(unique=True, validators=[core.lib.validators.validate_npm]), - ), - ] diff --git a/core/migrations/0014_company_category.py b/core/migrations/0014_company_category.py deleted file mode 100644 index 7d2db3c..0000000 --- a/core/migrations/0014_company_category.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 04:52 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0013_auto_20170602_1130'), - ] - - operations = [ - migrations.AddField( - model_name='company', - name='category', - field=models.CharField(default=b'Belum ada kategori perusahaan', max_length=140), - ), - ] diff --git a/core/migrations/0014_feedback.py b/core/migrations/0014_feedback.py deleted file mode 100644 index e818319..0000000 --- a/core/migrations/0014_feedback.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-03 13:39 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0013_auto_20170602_1130'), - ] - - operations = [ - migrations.CreateModel( - name='Feedback', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('title', models.CharField(blank=True, default=b'', max_length=100)), - ('content', models.TextField()), - ], - options={ - 'ordering': ['created'], - }, - ), - ] diff --git a/core/migrations/0014_student_linkedin_url.py b/core/migrations/0014_student_linkedin_url.py deleted file mode 100644 index b4bbeae..0000000 --- a/core/migrations/0014_student_linkedin_url.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 08:48 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0013_auto_20170602_1130'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='linkedin_url', - field=models.URLField(blank=True, null=True), - ), - ] diff --git a/core/migrations/0014_student_region.py b/core/migrations/0014_student_region.py deleted file mode 100644 index 702015e..0000000 --- a/core/migrations/0014_student_region.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-05 10:07 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0013_auto_20170602_1130'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='region', - field=models.CharField(blank=True, max_length=30, null=True), - ), - ] diff --git a/core/migrations/0014_vacancymilestone.py b/core/migrations/0014_vacancymilestone.py deleted file mode 100644 index 4ac5eba..0000000 --- a/core/migrations/0014_vacancymilestone.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 03:23 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0013_auto_20170602_1130'), - ] - - operations = [ - migrations.CreateModel( - name='VacancyMilestone', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('detail', models.TextField()), - ('expected_start', models.DateField()), - ('expected_finish', models.DateField()), - ('vacancy', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='milestones', to='core.Vacancy')), - ], - ), - ] diff --git a/core/migrations/0015_merge_20191005_1926.py b/core/migrations/0015_merge_20191005_1926.py deleted file mode 100644 index ae7f6c5..0000000 --- a/core/migrations/0015_merge_20191005_1926.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 12:26 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0014_feedback'), - ('core', '0014_company_category'), - ] - - operations = [ - ] diff --git a/core/migrations/0015_merge_20191005_1951.py b/core/migrations/0015_merge_20191005_1951.py deleted file mode 100644 index 81ba3fd..0000000 --- a/core/migrations/0015_merge_20191005_1951.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 12:51 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0014_feedback'), - ('core', '0014_company_category'), - ] - - operations = [ - ] diff --git a/core/migrations/0015_merge_20191005_1957.py b/core/migrations/0015_merge_20191005_1957.py deleted file mode 100644 index fe7de18..0000000 --- a/core/migrations/0015_merge_20191005_1957.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-05 12:57 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0014_feedback'), - ('core', '0014_company_category'), - ('core', '0014_student_region'), - ] - - operations = [ - ] diff --git a/core/migrations/0015_merge_20191005_2038.py b/core/migrations/0015_merge_20191005_2038.py deleted file mode 100644 index d4afc1b..0000000 --- a/core/migrations/0015_merge_20191005_2038.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 13:38 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0014_feedback'), - ('core', '0014_company_category'), - ] - - operations = [ - ] diff --git a/core/migrations/0016_merge_20191005_2235.py b/core/migrations/0016_merge_20191005_2235.py deleted file mode 100644 index eb0946c..0000000 --- a/core/migrations/0016_merge_20191005_2235.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 15:35 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0015_merge_20191005_1926'), - ('core', '0015_merge_20191005_1957'), - ] - - operations = [ - ] diff --git a/core/migrations/0016_merge_20191005_2256.py b/core/migrations/0016_merge_20191005_2256.py deleted file mode 100644 index e8b0c6b..0000000 --- a/core/migrations/0016_merge_20191005_2256.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 15:56 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0015_merge_20191005_1957'), - ('core', '0014_student_linkedin_url'), - ] - - operations = [ - ] diff --git a/core/migrations/0017_merge_20191006_0134.py b/core/migrations/0017_merge_20191006_0134.py deleted file mode 100644 index d41f21a..0000000 --- a/core/migrations/0017_merge_20191006_0134.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 18:34 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0015_merge_20191005_2038'), - ('core', '0016_merge_20191005_2235'), - ] - - operations = [ - ] diff --git a/core/migrations/0017_merge_20191006_0146.py b/core/migrations/0017_merge_20191006_0146.py deleted file mode 100644 index e6dd3d9..0000000 --- a/core/migrations/0017_merge_20191006_0146.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 18:46 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0015_merge_20191005_1951'), - ('core', '0016_merge_20191005_2235'), - ] - - operations = [ - ] diff --git a/core/migrations/0017_vacancy_amount.py b/core/migrations/0017_vacancy_amount.py deleted file mode 100644 index e4c4c91..0000000 --- a/core/migrations/0017_vacancy_amount.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 19:35 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0016_merge_20191005_2235'), - ] - - operations = [ - migrations.AddField( - model_name='vacancy', - name='amount', - field=models.IntegerField(null=True), - ), - ] diff --git a/core/migrations/0018_merge_20191006_0603.py b/core/migrations/0018_merge_20191006_0603.py deleted file mode 100644 index f3a0c37..0000000 --- a/core/migrations/0018_merge_20191006_0603.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-05 23:03 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0016_merge_20191005_2256'), - ('core', '0017_merge_20191006_0134'), - ] - - operations = [ - ] diff --git a/core/migrations/0018_student_intro.py b/core/migrations/0018_student_intro.py deleted file mode 100644 index fa1b78c..0000000 --- a/core/migrations/0018_student_intro.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-05 22:59 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_merge_20191006_0134'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='intro', - field=models.CharField(blank=True, max_length=50, null=True), - ), - ] diff --git a/core/migrations/0018_student_ui_ux_portofolio.py b/core/migrations/0018_student_ui_ux_portofolio.py deleted file mode 100644 index 60dd4be..0000000 --- a/core/migrations/0018_student_ui_ux_portofolio.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 10:14 -from __future__ import unicode_literals - -import core.lib.validators -import core.models.accounts -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_merge_20191006_0134'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='ui_ux_portofolio', - field=models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_ui_ux_portofolio_file_path, validators=[core.lib.validators.validate_document_file_extension]), - ), - ] diff --git a/core/migrations/0019_auto_20191006_0922.py b/core/migrations/0019_auto_20191006_0922.py deleted file mode 100644 index 61b9d93..0000000 --- a/core/migrations/0019_auto_20191006_0922.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 02:22 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0018_merge_20191006_0603'), - ] - - operations = [ - migrations.AlterField( - model_name='company', - name='category', - field=models.CharField(default='Belum ada kategori perusahaan', max_length=140), - ), - migrations.AlterField( - model_name='feedback', - name='title', - field=models.CharField(blank=True, default='', max_length=100), - ), - ] diff --git a/core/migrations/0019_merge_20191006_0852.py b/core/migrations/0019_merge_20191006_0852.py deleted file mode 100644 index 38ac5fa..0000000 --- a/core/migrations/0019_merge_20191006_0852.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 01:52 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0018_student_intro'), - ('core', '0018_merge_20191006_0603'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_auto_20191006_1507.py b/core/migrations/0020_auto_20191006_1507.py deleted file mode 100644 index df6b901..0000000 --- a/core/migrations/0020_auto_20191006_1507.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 08:07 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0019_auto_20191006_0922'), - ] - - operations = [ - migrations.AddField( - model_name='student', - name='latest_work', - field=models.CharField(blank=True, max_length=50, null=True), - ), - migrations.AddField( - model_name='student', - name='latest_work_desc', - field=models.TextField(blank=True, null=True), - ), - ] diff --git a/core/migrations/0020_merge_20191006_1406.py b/core/migrations/0020_merge_20191006_1406.py deleted file mode 100644 index 12d371c..0000000 --- a/core/migrations/0020_merge_20191006_1406.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 07:06 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_vacancy_amount'), - ('core', '0019_merge_20191006_0852'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_merge_20191006_1444.py b/core/migrations/0020_merge_20191006_1444.py deleted file mode 100644 index 3f808ab..0000000 --- a/core/migrations/0020_merge_20191006_1444.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 07:44 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_vacancy_amount'), - ('core', '0019_merge_20191006_0852'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_merge_20191006_1456.py b/core/migrations/0020_merge_20191006_1456.py deleted file mode 100644 index 3d0cb5d..0000000 --- a/core/migrations/0020_merge_20191006_1456.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 07:56 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_vacancy_amount'), - ('core', '0019_merge_20191006_0852'), - ('core', '0017_merge_20191006_0146'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_merge_20191006_1513.py b/core/migrations/0020_merge_20191006_1513.py deleted file mode 100644 index b3fdf59..0000000 --- a/core/migrations/0020_merge_20191006_1513.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 08:13 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0014_vacancymilestone'), - ('core', '0017_vacancy_amount'), - ('core', '0019_merge_20191006_0852'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_merge_20191006_1558.py b/core/migrations/0020_merge_20191006_1558.py deleted file mode 100644 index abf6f22..0000000 --- a/core/migrations/0020_merge_20191006_1558.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 08:58 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_vacancy_amount'), - ('core', '0019_merge_20191006_0852'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_merge_20191006_1737.py b/core/migrations/0020_merge_20191006_1737.py deleted file mode 100644 index 26ff28e..0000000 --- a/core/migrations/0020_merge_20191006_1737.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 10:37 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0019_merge_20191006_0852'), - ('core', '0017_vacancy_amount'), - ('core', '0014_auto_20191004_1340'), - ] - - operations = [ - ] diff --git a/core/migrations/0020_merge_20191007_0648.py b/core/migrations/0020_merge_20191007_0648.py deleted file mode 100644 index 3a42b13..0000000 --- a/core/migrations/0020_merge_20191007_0648.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 23:48 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0017_vacancy_amount'), - ('core', '0019_merge_20191006_0852'), - ('core', '0014_auto_20191004_1340'), - ] - - operations = [ - ] diff --git a/core/migrations/0021_auto_20191006_1608.py b/core/migrations/0021_auto_20191006_1608.py deleted file mode 100644 index 859f786..0000000 --- a/core/migrations/0021_auto_20191006_1608.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 09:08 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_auto_20191006_1507'), - ] - - operations = [ - migrations.AlterField( - model_name='student', - name='latest_work', - field=models.CharField(blank=True, max_length=100, null=True), - ), - ] diff --git a/core/migrations/0021_auto_20191007_0648.py b/core/migrations/0021_auto_20191007_0648.py deleted file mode 100644 index 743bfd3..0000000 --- a/core/migrations/0021_auto_20191007_0648.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 23:48 -from __future__ import unicode_literals - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_merge_20191007_0648'), - ] - - operations = [ - migrations.AlterField( - model_name='company', - name='website', - field=models.CharField(default=b'Belum ada link website', max_length=100), - ), - migrations.AlterField( - model_name='student', - name='phone_number', - field=models.CharField(blank=True, db_index=True, max_length=12, null=True, validators=[django.core.validators.RegexValidator(b'^0\\d{1,11}$')]), - ), - ] diff --git a/core/migrations/0021_merge_20191006_1640.py b/core/migrations/0021_merge_20191006_1640.py deleted file mode 100644 index 2ed2f5e..0000000 --- a/core/migrations/0021_merge_20191006_1640.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-06 09:40 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_merge_20191006_1558'), - ('core', '0014_auto_20191004_1340'), - ] - - operations = [ - ] diff --git a/core/migrations/0021_vacancy_salary.py b/core/migrations/0021_vacancy_salary.py deleted file mode 100644 index 94f1f06..0000000 --- a/core/migrations/0021_vacancy_salary.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 07:07 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_merge_20191006_1406'), - ] - - operations = [ - migrations.AddField( - model_name='vacancy', - name='salary', - field=models.IntegerField(default=0), - ), - ] diff --git a/core/migrations/0022_merge_20191006_1851.py b/core/migrations/0022_merge_20191006_1851.py deleted file mode 100644 index 491bfd9..0000000 --- a/core/migrations/0022_merge_20191006_1851.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-06 11:51 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0019_merge_20191006_0852'), - ('core', '0017_vacancy_amount'), - ('core', '0021_auto_20191006_1608'), - ('core', '0014_auto_20191004_1340'), - ] - - operations = [ - ] diff --git a/core/migrations/0023_merge_20191007_1533.py b/core/migrations/0023_merge_20191007_1533.py deleted file mode 100644 index 4595bb4..0000000 --- a/core/migrations/0023_merge_20191007_1533.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 08:33 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0021_vacancy_salary'), - ('core', '0022_merge_20191006_1851'), - ] - - operations = [ - ] diff --git a/core/migrations/0023_merge_20191007_1837.py b/core/migrations/0023_merge_20191007_1837.py deleted file mode 100644 index 5125221..0000000 --- a/core/migrations/0023_merge_20191007_1837.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 11:37 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0022_merge_20191006_1851'), - ('core', '0020_merge_20191006_1456'), - ('core', '0021_vacancy_salary'), - ] - - operations = [ - ] diff --git a/core/migrations/0024_auto_20191007_1533.py b/core/migrations/0024_auto_20191007_1533.py deleted file mode 100644 index f6e0f4a..0000000 --- a/core/migrations/0024_auto_20191007_1533.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 08:33 -from __future__ import unicode_literals - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0023_merge_20191007_1533'), - ] - - operations = [ - migrations.AddField( - model_name='company', - name='website', - field=models.CharField(default='Belum ada link website', max_length=100), - ), - migrations.AlterField( - model_name='student', - name='phone_number', - field=models.CharField(blank=True, db_index=True, max_length=12, null=True, validators=[django.core.validators.RegexValidator('^0\\d{1,11}$')]), - ), - ] diff --git a/core/migrations/0024_auto_20191007_2023.py b/core/migrations/0024_auto_20191007_2023.py deleted file mode 100644 index 2b69354..0000000 --- a/core/migrations/0024_auto_20191007_2023.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 13:23 -from __future__ import unicode_literals - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0023_merge_20191007_1837'), - ] - - operations = [ - migrations.AddField( - model_name='company', - name='website', - field=models.CharField(default=b'Belum ada link website', max_length=100), - ), - migrations.AlterField( - model_name='student', - name='phone_number', - field=models.CharField(blank=True, db_index=True, max_length=12, null=True, validators=[django.core.validators.RegexValidator(b'^0\\d{1,11}$')]), - ), - ] diff --git a/core/migrations/0025_merge_20191007_1810.py b/core/migrations/0025_merge_20191007_1810.py deleted file mode 100644 index 5619c26..0000000 --- a/core/migrations/0025_merge_20191007_1810.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 11:10 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0021_auto_20191007_0648'), - ('core', '0024_auto_20191007_1533'), - ] - - operations = [ - ] diff --git a/core/migrations/0025_merge_20191007_2124.py b/core/migrations/0025_merge_20191007_2124.py deleted file mode 100644 index 8e208cb..0000000 --- a/core/migrations/0025_merge_20191007_2124.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-07 14:24 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0024_auto_20191007_1533'), - ('core', '0020_merge_20191006_1737'), - ] - - operations = [ - ] diff --git a/core/migrations/0025_merge_20191008_0014.py b/core/migrations/0025_merge_20191008_0014.py deleted file mode 100644 index 29cd7dd..0000000 --- a/core/migrations/0025_merge_20191008_0014.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 17:14 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_merge_20191006_1444'), - ('core', '0024_auto_20191007_1533'), - ] - - operations = [ - ] diff --git a/core/migrations/0025_merge_20191008_0048.py b/core/migrations/0025_merge_20191008_0048.py deleted file mode 100644 index 94af1f7..0000000 --- a/core/migrations/0025_merge_20191008_0048.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-07 17:48 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_merge_20191006_1513'), - ('core', '0024_auto_20191007_1533'), - ] - - operations = [ - ] diff --git a/core/migrations/0026_merge_20191008_0256.py b/core/migrations/0026_merge_20191008_0256.py deleted file mode 100644 index 319247f..0000000 --- a/core/migrations/0026_merge_20191008_0256.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-07 19:56 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0018_student_ui_ux_portofolio'), - ('core', '0025_merge_20191008_0048'), - ('core', '0025_merge_20191007_2124'), - ] - - operations = [ - ] diff --git a/core/migrations/0026_merge_20191008_0525.py b/core/migrations/0026_merge_20191008_0525.py deleted file mode 100644 index 31a0321..0000000 --- a/core/migrations/0026_merge_20191008_0525.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 22:25 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0025_merge_20191007_1810'), - ('core', '0025_merge_20191007_2124'), - ('core', '0025_merge_20191008_0048'), - ] - - operations = [ - ] diff --git a/core/migrations/0027_merge_20191008_0646.py b/core/migrations/0027_merge_20191008_0646.py deleted file mode 100644 index 7c93015..0000000 --- a/core/migrations/0027_merge_20191008_0646.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-07 23:46 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0026_merge_20191008_0256'), - ('core', '0021_merge_20191006_1640'), - ] - - operations = [ - ] diff --git a/core/migrations/0027_merge_20191008_0652.py b/core/migrations/0027_merge_20191008_0652.py deleted file mode 100644 index cd5f54d..0000000 --- a/core/migrations/0027_merge_20191008_0652.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-07 23:52 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0026_merge_20191008_0525'), - ('core', '0026_merge_20191008_0256'), - ] - - operations = [ - ] diff --git a/core/migrations/0028_merge_20191008_0843.py b/core/migrations/0028_merge_20191008_0843.py deleted file mode 100644 index ddf4486..0000000 --- a/core/migrations/0028_merge_20191008_0843.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-08 01:43 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0027_merge_20191008_0652'), - ('core', '0027_merge_20191008_0646'), - ] - - operations = [ - ] diff --git a/core/migrations/0028_merge_20191008_0921.py b/core/migrations/0028_merge_20191008_0921.py deleted file mode 100644 index 2e5e9f0..0000000 --- a/core/migrations/0028_merge_20191008_0921.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-08 02:21 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0027_merge_20191008_0652'), - ('core', '0025_merge_20191008_0014'), - ] - - operations = [ - ] diff --git a/core/migrations/0029_merge_20191008_1146.py b/core/migrations/0029_merge_20191008_1146.py deleted file mode 100644 index f6ee5c7..0000000 --- a/core/migrations/0029_merge_20191008_1146.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2019-10-08 04:46 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0028_merge_20191008_0843'), - ('core', '0028_merge_20191008_0921'), - ] - - operations = [ - ] -- GitLab From 556ade3962fea7c0c19f4284185025b9524ac053 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Tue, 8 Oct 2019 16:32:49 +0700 Subject: [PATCH 08/21] edit error --- core/tests/test_create_vacancies.py | 2 +- core/views/vacancies.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 8f8c39d..54e0676 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime, timedelta import requests_mock from django.contrib.auth.models import User diff --git a/core/views/vacancies.py b/core/views/vacancies.py index 8065daa..f23e7f1 100644 --- a/core/views/vacancies.py +++ b/core/views/vacancies.py @@ -88,7 +88,7 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): salary = data.get('salary') or 0 description = data['description'] today_date = timezone.now() - timezone.timedelta(days=1) - if parse_date(open_time) < today_date: + if open_time < today_date: raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') elif close_time <= open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan dan tidak sama dengan waktu pembukaan lowongan!') @@ -110,7 +110,7 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): name = data['name'] description = data['description'] today_date = timezone.now() - timezone.timedelta(days=1) - if parse_date(open_time) < today_date: + if open_time < today_date: raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') elif close_time <= open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan dan tidak sama dengan waktu pembukaan lowongan!') -- GitLab From 5311351f24009c5210e25b94f3eee981fd7e8c71 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Fri, 11 Oct 2019 21:43:17 +0700 Subject: [PATCH 09/21] Fix error --- core/migrations/0001_initial.py | 90 +++--------------- core/migrations/0020_merge_20191006_1444.py | 16 ++++ .../9db3b100-d366-4834-9983-cb5ff38b3861.pdf | Bin 0 -> 14052 bytes 3 files changed, 28 insertions(+), 78 deletions(-) create mode 100644 core/migrations/0020_merge_20191006_1444.py create mode 100644 kape/files/student-ui-ux-portofolio/9db3b100-d366-4834-9983-cb5ff38b3861.pdf diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py index 1c41f1e..adb92de 100644 --- a/core/migrations/0001_initial.py +++ b/core/migrations/0001_initial.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-10-08 09:17 +# Generated by Django 1.10.5 on 2017-03-28 04:06 from __future__ import unicode_literals -import core.lib.validators import core.models.accounts from django.conf import settings import django.core.validators @@ -23,8 +22,6 @@ class Migration(migrations.Migration): name='Application', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('cover_letter', models.TextField(blank=True, null=True)), - ('status', models.IntegerField(default=0)), ], ), migrations.CreateModel( @@ -34,28 +31,11 @@ class Migration(migrations.Migration): ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('description', models.TextField()), - ('status', models.IntegerField(default=0)), - ('logo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_company_logo_file_path, validators=[core.lib.validators.validate_image_file_extension])), - ('address', models.CharField(blank=True, max_length=1000, null=True)), - ('category', models.CharField(default=b'Belum ada kategori perusahaan', max_length=140)), - ('website', models.CharField(default=b'Belum ada link website', max_length=100)), + ('verified', models.BooleanField(default=False)), + ('logo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_company_logo_file_path)), + ('alamat', models.CharField(blank=True, max_length=1000, null=True)), ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], - options={ - 'ordering': ['-updated'], - }, - ), - migrations.CreateModel( - name='Feedback', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('title', models.CharField(blank=True, default=b'', max_length=100)), - ('content', models.TextField()), - ], - options={ - 'ordering': ['created'], - }, ), migrations.CreateModel( name='Student', @@ -63,25 +43,10 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('npm', models.IntegerField(unique=True, validators=[core.lib.validators.validate_npm])), - ('resume', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_resume_file_path, validators=[core.lib.validators.validate_document_file_extension])), - ('phone_number', models.CharField(blank=True, db_index=True, max_length=12, null=True, validators=[django.core.validators.RegexValidator(b'^0\\d{1,11}$')])), - ('birth_place', models.CharField(blank=True, max_length=30, null=True)), - ('birth_date', models.DateField(blank=True, null=True)), - ('major', models.CharField(blank=True, max_length=30, null=True)), - ('batch', models.CharField(blank=True, max_length=4, null=True)), - ('show_transcript', models.BooleanField(default=False)), - ('photo', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_photo_file_path, validators=[core.lib.validators.validate_image_file_extension])), - ('linkedin_url', models.URLField(blank=True, null=True)), - ('region', models.CharField(blank=True, max_length=30, null=True)), - ('ui_ux_portofolio', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_ui_ux_portofolio_file_path, validators=[core.lib.validators.validate_document_file_extension])), - ('latest_work', models.CharField(blank=True, max_length=100, null=True)), - ('latest_work_desc', models.TextField(blank=True, null=True)), - ('intro', models.CharField(blank=True, max_length=50, null=True)), + ('npm', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999)])), + ('resume', models.FileField(blank=True, null=True, upload_to=core.models.accounts.get_student_resume_file_path)), + ('phone_number', models.CharField(blank=True, db_index=True, max_length=100, null=True)), ], - options={ - 'ordering': ['-updated'], - }, ), migrations.CreateModel( name='Supervisor', @@ -92,9 +57,6 @@ class Migration(migrations.Migration): ('nip', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999)])), ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], - options={ - 'ordering': ['-updated'], - }, ), migrations.CreateModel( name='Vacancy', @@ -104,37 +66,13 @@ class Migration(migrations.Migration): ('open_time', models.DateTimeField()), ('description', models.TextField(blank=True)), ('close_time', models.DateTimeField()), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=100)), - ('amount', models.IntegerField(null=True)), - ('salary', models.IntegerField(default=0)), ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vacancies', to='core.Company')), ], - options={ - 'ordering': ['-updated'], - }, - ), - migrations.CreateModel( - name='VacancyMilestone', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('detail', models.TextField()), - ('expected_start', models.DateField()), - ('expected_finish', models.DateField()), - ('vacancy', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='milestones', to='core.Vacancy')), - ], - ), - migrations.AddField( - model_name='student', - name='applied_vacancies', - field=models.ManyToManyField(blank=True, related_name='applied_vacancies', through='core.Application', to='core.Vacancy'), ), migrations.AddField( model_name='student', name='bookmarked_vacancies', - field=models.ManyToManyField(blank=True, related_name='bookmarked_vacancies', to='core.Vacancy'), + field=models.ManyToManyField(blank=True, to='core.Vacancy'), ), migrations.AddField( model_name='student', @@ -143,16 +81,12 @@ class Migration(migrations.Migration): ), migrations.AddField( model_name='application', - name='student', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Student'), + name='student_npm', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.Student'), ), migrations.AddField( model_name='application', - name='vacancy', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Vacancy'), - ), - migrations.AlterUniqueTogether( - name='application', - unique_together=set([('student', 'vacancy')]), + name='vacancy_id', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.Vacancy'), ), ] diff --git a/core/migrations/0020_merge_20191006_1444.py b/core/migrations/0020_merge_20191006_1444.py new file mode 100644 index 0000000..3f808ab --- /dev/null +++ b/core/migrations/0020_merge_20191006_1444.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2019-10-06 07:44 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0017_vacancy_amount'), + ('core', '0019_merge_20191006_0852'), + ] + + operations = [ + ] diff --git a/kape/files/student-ui-ux-portofolio/9db3b100-d366-4834-9983-cb5ff38b3861.pdf b/kape/files/student-ui-ux-portofolio/9db3b100-d366-4834-9983-cb5ff38b3861.pdf new file mode 100644 index 0000000000000000000000000000000000000000..379cb93fd41385e7ea21e9f02d44b2fb84fd860d GIT binary patch literal 14052 zcmch8byQqWwr&U(JOpX-PgTN)!B9GRGshJU)5Ttdv8hwQE^6ACJsc(_M5C{L^e_uQd>g{M1Fo!=FjFf zAOm}IcaSkD>#Ie|%Fe>UM#?Nns!htt%|*(}#!jk3$}CUHNy;on$_n7(;v!|1`_onB zZx$!1fB+)M#`w>0r2oG^h=6|rqT==yM9Qq81TuMr0kSc5G$Z9;A!Qafw{is8zt&a; zjv!Hxk*)D-ufJ*q1AA)+(my1K*jhPR+c=Q2lQJvVgN)6M9Bu7ip}%4yWmbP>f|Zo* z^?2n$%ElPv`r7bna{OhR*pjlczCMN$DYKHTt>fzue>+!xWt5clm8;kBod3?-f2D_6 zN|aQapT!si0vNHfumKENIoSXP>?Ry6Y{n*rhHNY#E>0eh!2i96&L1Z@INE~@tPx#P zj0}y}O!W=*xe-1l#C_Kg|Ma~QPIL+0jsyy!b%wMI9~xs*Q!fG+nu7D~8^SC&mOt+M z`_2Cwjzs*!$bYC!!N3&c@T#%DNcziVA_k5IR<@@9BqWZ1y5qm~pE4=nRgZu7GCSA5 z!q?Z=2kGl;jlF>pAHrRGGiU;5i2Z{`k`WicvShjj9W~pF3}H~meG_*FbN=txIsa*H z5nCHakd31QDc4`mEBh)917X`g0$_Rla`14Hae=-^dKuO0srm=egr*2&)J73v># ziMcvTC_BE&?{Ag_;E%HYh~$sD#9ycQTeCR(t4jW}S;5}cNEzh#IuY~h(tTZQAXmp% z^;y5tC;azX->L4Qg*a=G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=`wL+wdku5b_mdUlt;3=?>e!KH0kDLJwXD8Ov__2b@)DcIXVm@YIXzscweEbEPSN)eC1<}~)mxx|Pg=ipBg!GEi)phH8q`;r^X-$O0xn(};=t%sI-H21xd|d&?B32} z2rEAf+2Z2>%LaIjWdKF9l1}3SQcj2iFH>k1DNFI&2W>d@tf7UF&DO8mKJ^MVMsfU3 z2pp0@@88*aNV8%UrI36wvgP?VmRSGf8vIAh{$D};@`e`5j@JLkfB?MaS(dygKEo&R!hM-?Pn&{pNtv&B;n>@)*CUEKci=7b7 z74Bi_$ZJ0d(MlCe)$lcG>AQ6}^ZK+_1yO1W(@UuxObtyyHyJADY0KHlErr*+it@4$ zOq>9KqY>R=yOF7){HNd5q6aFpgPg~uPBYs9Ga*)%_-J6N#)KS6A5|(EFB6~sme2H>7xurE vvh?OHmH1RJ@|(BTP{{wDl=ELQr(ScN4D20U?Lj7pY^ Date: Fri, 11 Oct 2019 21:49:57 +0700 Subject: [PATCH 10/21] Update test --- core/tests/test_create_vacancies.py | 61 ----------------------------- 1 file changed, 61 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index b3f30fa..2527425 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -102,13 +102,8 @@ class CreateAndUpdateVacancyTest(APITestCase): description="lalala", close_time= today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') -======= response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_200_OK) def test_update_vacancy_with_amount_salary_success(self): @@ -124,13 +119,8 @@ class CreateAndUpdateVacancyTest(APITestCase): description="lalala", close_time=today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10}, format='json') -======= response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'salary': 2, 'responsibilities': 'new_vacancy2'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() @@ -166,13 +156,8 @@ class CreateAndUpdateVacancyTest(APITestCase): description="lalala", close_time= today + day, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today + day, 'close_time': today, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') -======= response = self.client.patch(url, {'open_time': datetime.today(), 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_update_vacancy_with_amount_salary_string_failed(self): @@ -195,8 +180,6 @@ class CreateAndUpdateVacancyTest(APITestCase): vacancy = Vacancy.objects.first() self.assertEqual(vacancy.amount, None) -<<<<<<< HEAD -======= def test_create_vacancy_with_same_date_failed(self): superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, @@ -213,7 +196,6 @@ class CreateAndUpdateVacancyTest(APITestCase): vacancies = Vacancy.objects.count() self.assertEqual(vacancies,0) ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 def test_new_vacancy_on_same_day_with_failed(self): superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') @@ -224,14 +206,9 @@ class CreateAndUpdateVacancyTest(APITestCase): today = datetime.today() url = '/api/vacancies/' -<<<<<<< HEAD - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') -======= response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies = Vacancy.objects.count() @@ -266,30 +243,6 @@ class CreateAndUpdateVacancyTest(APITestCase): description="lalala", close_time=datetime.today(), name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today, 'close_time': today, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - def test_create_vacancy_with_the_date_before_today(self): - superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') - new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, - address=None) - self.client.force_authenticate(user=superuser) - - day = datetime.timedelta(days=1) - today = datetime.today() - - url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today - day, - 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - vacancies = Vacancy.objects.count() - self.assertEqual(vacancies,0) - - def test_update_vacancy_with_the_day_before_today(self): -======= response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') @@ -299,24 +252,11 @@ class CreateAndUpdateVacancyTest(APITestCase): self.assertEqual(vacancy.amount, None) def test_update_vacancy_with_responsibilities_failed(self): ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, address=None) self.client.force_authenticate(user=superuser) -<<<<<<< HEAD - day = datetime.timedelta(days=1) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today - day, - description="lalala", close_time= today + day, name='new_company') - - url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today - day, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) -======= new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), description="lalala", close_time=datetime.today(), name='new_company') @@ -327,4 +267,3 @@ class CreateAndUpdateVacancyTest(APITestCase): vacancy = Vacancy.objects.first() self.assertEqual(vacancy.responsibilities, '') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 -- GitLab From 21e79061522aa9b0f6c074093f59124cac51df70 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Fri, 11 Oct 2019 22:18:44 +0700 Subject: [PATCH 11/21] Edit functionality --- core/tests/test_create_vacancies.py | 119 +++++----------------------- core/views/vacancies.py | 4 +- 2 files changed, 21 insertions(+), 102 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index b3f30fa..5d07388 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -16,10 +16,9 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - day = datetime.timedelta(days=1) - today = datetime.today() - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy '}, format='json') + day = datetime.timedelta(1) + response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.today(), + 'close_time': datetime.today() - day, 'name': 'new vacancy', 'description': 'new_vacancy '}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancies = Vacancy.objects.count() @@ -32,10 +31,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - day = datetime.timedelta(days=1) - today = datetime.today() - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': today + day, 'name': 'new_vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), + 'close_time': datetime.today(), 'name': 'new vacancy', 'description': 'new_vacancy ', 'amount': 10}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -79,11 +76,9 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - day = datetime.timedelta(days=1) - today = datetime.today() - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': today + day, 'name': 'new_vacancy', - 'description': 'new_vacancy ', 'amount': 'sepuluh'}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), + 'close_time': datetime.today(), 'name': 'new_vacancy', + 'description': 'new_vacancy ', 'amount': 'sepuluh', 'salary':'dua juta'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies_count = Vacancy.objects.count() @@ -95,20 +90,12 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - day = datetime.timedelta(days=1) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today, - description="lalala", close_time= today + day, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), + description="lalala", close_time=datetime.today(), name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') -======= response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_200_OK) def test_update_vacancy_with_amount_salary_success(self): @@ -117,20 +104,12 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - day = datetime.timedelta(days=1) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=today + day, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), + description="lalala", close_time=datetime.today(), name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10}, format='json') -======= response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'salary': 2, 'responsibilities': 'new_vacancy2'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() @@ -159,20 +138,12 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - day = datetime.timedelta(days=1) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time= today + day, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), + description="lalala", close_time=datetime.today(), name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today + day, 'close_time': today, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') -======= response = self.client.patch(url, {'open_time': datetime.today(), 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_update_vacancy_with_amount_salary_string_failed(self): @@ -181,22 +152,17 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - day = datetime.timedelta(days=1) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time= today + day, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), + description="lalala", close_time=datetime.today(), name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') + response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'salary': 'dua juta'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() self.assertEqual(vacancy.amount, None) -<<<<<<< HEAD -======= def test_create_vacancy_with_same_date_failed(self): superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, @@ -213,7 +179,6 @@ class CreateAndUpdateVacancyTest(APITestCase): vacancies = Vacancy.objects.count() self.assertEqual(vacancies,0) ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 def test_new_vacancy_on_same_day_with_failed(self): superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') @@ -221,17 +186,10 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - today = datetime.today() - url = '/api/vacancies/' -<<<<<<< HEAD - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') -======= response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies = Vacancy.objects.count() @@ -261,35 +219,10 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - today = datetime.today() new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), description="lalala", close_time=datetime.today(), name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -<<<<<<< HEAD - response = self.client.patch(url, {'open_time': today, 'close_time': today, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - def test_create_vacancy_with_the_date_before_today(self): - superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') - new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, - address=None) - self.client.force_authenticate(user=superuser) - - day = datetime.timedelta(days=1) - today = datetime.today() - - url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today - day, - 'close_time': today + day, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - vacancies = Vacancy.objects.count() - self.assertEqual(vacancies,0) - - def test_update_vacancy_with_the_day_before_today(self): -======= response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') @@ -299,24 +232,11 @@ class CreateAndUpdateVacancyTest(APITestCase): self.assertEqual(vacancy.amount, None) def test_update_vacancy_with_responsibilities_failed(self): ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, address=None) self.client.force_authenticate(user=superuser) -<<<<<<< HEAD - day = datetime.timedelta(days=1) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today - day, - description="lalala", close_time= today + day, name='new_company') - - url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today - day, 'close_time': today + day, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) -======= new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), description="lalala", close_time=datetime.today(), name='new_company') @@ -326,5 +246,4 @@ class CreateAndUpdateVacancyTest(APITestCase): self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() - self.assertEqual(vacancy.responsibilities, '') ->>>>>>> 5e2c91220bc84a206d06a5a3803dc955ea8ac201 + self.assertEqual(vacancy.responsibilities, '') \ No newline at end of file diff --git a/core/views/vacancies.py b/core/views/vacancies.py index ba3069a..29f9f64 100755 --- a/core/views/vacancies.py +++ b/core/views/vacancies.py @@ -88,7 +88,7 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): salary = data.get('salary') or 0 description = data['description'] today_date = timezone.now() - timezone.timedelta(days=1) - if open_time < today_date: + if parse_date(open_time) < today_date: raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') elif close_time <= open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan dan tidak sama dengan waktu pembukaan lowongan!') @@ -117,7 +117,7 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): name = data['name'] description = data['description'] today_date = timezone.now() - timezone.timedelta(days=1) - if open_time < today_date: + if parse_date(open_time) < today_date: raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') elif close_time <= open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan dan tidak sama dengan waktu pembukaan lowongan!') -- GitLab From b176dd43afcbd3b2e8be2a0cf6ce8b5c07a4e078 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Fri, 11 Oct 2019 22:45:40 +0700 Subject: [PATCH 12/21] fix error --- core/tests/test_create_vacancies.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 5d07388..faf54f8 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -47,8 +47,9 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), - 'close_time': datetime.today(), 'name': 'new_vacancy', + day = datetime.timedelta(1) + response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.today(), + 'close_time': datetime.today() + day, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) -- GitLab From eff712ef59e45b5fff5516ca0bd5dcb3728f7874 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 14:54:45 +0700 Subject: [PATCH 13/21] Fix datetime error --- core/views/vacancies.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/views/vacancies.py b/core/views/vacancies.py index 29f9f64..b037e82 100755 --- a/core/views/vacancies.py +++ b/core/views/vacancies.py @@ -1,6 +1,6 @@ import requests +from datetime import datetime -from dateutil.parser import parse as parse_date from django.utils import timezone from django.conf import settings from django.db.models import Q @@ -87,8 +87,7 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): self.name_position_validator(name) salary = data.get('salary') or 0 description = data['description'] - today_date = timezone.now() - timezone.timedelta(days=1) - if parse_date(open_time) < today_date: + if open_time < str(datetime.today()): raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') elif close_time <= open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan dan tidak sama dengan waktu pembukaan lowongan!') @@ -116,8 +115,7 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet): close_time = data['close_time'] name = data['name'] description = data['description'] - today_date = timezone.now() - timezone.timedelta(days=1) - if parse_date(open_time) < today_date: + if open_time < str(datetime.today()): raise ValidationError('Waktu buka lowongan harus lebih dari hari ini!') elif close_time <= open_time: raise ValidationError('Waktu tutup lowongan harus lebih dari waktu buka lowongan dan tidak sama dengan waktu pembukaan lowongan!') -- GitLab From 1aa251feac46d183d350b2d53bc47a1643a2d62b Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 15:06:54 +0700 Subject: [PATCH 14/21] Fix error --- core/tests/test_create_vacancies.py | 109 ++++++++++++++++++---------- 1 file changed, 72 insertions(+), 37 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index faf54f8..d42cebb 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -9,6 +9,12 @@ from core.models.accounts import Company, Student, Supervisor from core.models.vacancies import Vacancy, Application class CreateAndUpdateVacancyTest(APITestCase): + + today = datetime.today() + day = timedelta(days = 1) + tomorrow = today + day + yesterday = today - day + def test_new_vacancy_success(self): superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, @@ -16,9 +22,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - day = datetime.timedelta(1) - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.today(), - 'close_time': datetime.today() - day, 'name': 'new vacancy', 'description': 'new_vacancy '}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy '}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancies = Vacancy.objects.count() @@ -31,8 +36,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), - 'close_time': datetime.today(), 'name': 'new vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy ', 'amount': 10}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -47,9 +52,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - day = datetime.timedelta(1) - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.today(), - 'close_time': datetime.today() + day, 'name': 'new_vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': tomorrow, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -63,8 +67,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.today(), - 'close_time': datetime.fromtimestamp(0), 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy'}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': yesterday, 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies = Vacancy.objects.count() @@ -77,8 +81,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': datetime.fromtimestamp(0), - 'close_time': datetime.today(), 'name': 'new_vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': today, + 'close_time': tomorrow, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 'sepuluh', 'salary':'dua juta'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -91,11 +95,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -105,11 +109,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'salary': 2, 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -122,11 +126,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -139,11 +143,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.today(), 'close_time': datetime.fromtimestamp(0), + response = self.client.patch(url, {'open_time': today, 'close_time': yesterday, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -153,11 +157,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': yesterday, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'salary': 'dua juta'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -170,8 +174,6 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - today = datetime.today() - url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': today, 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') @@ -204,8 +206,8 @@ class CreateAndUpdateVacancyTest(APITestCase): today = datetime.today() - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' @@ -220,8 +222,8 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' @@ -238,13 +240,46 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=datetime.fromtimestamp(0), - description="lalala", close_time=datetime.today(), name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.today(), + response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() - self.assertEqual(vacancy.responsibilities, '') \ No newline at end of file + self.assertEqual(vacancy.responsibilities, '') + + def test_create_vacancy_with_open_time_before_today_failed(self): + superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') + new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, + address=None) + self.client.force_authenticate(user=superuser) + + url = '/api/vacancies/' + response = self.client.post(url, {'company': new_company.pk, 'open_time': yesterday, + 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') + + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + + vacancies = Vacancy.objects.count() + self.assertEqual(vacancies,0) + + def test_update_vacancy_with_open_time_before_today_failed(self): + superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') + new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, + address=None) + self.client.force_authenticate(user=superuser) + + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, + description="lalala", close_time=tomorrow, name='new_company') + + url = '/api/vacancies/' + str(new_vacancy.pk) + '/' + + response = self.client.patch(url, {'open_time': yesterday, 'close_time': today, + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + + vacancy = Vacancy.objects.first() + self.assertEqual(vacancy.amount, None) \ No newline at end of file -- GitLab From 4e39f7a649675b16142ad35b08d3c41ae3fcf18a Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 15:20:39 +0700 Subject: [PATCH 15/21] edit global variable --- core/tests/test_create_vacancies.py | 78 ++++++++++++++--------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index d42cebb..310f64d 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -22,8 +22,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy '}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, + 'close_time': self.tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy '}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancies = Vacancy.objects.count() @@ -36,8 +36,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': tomorrow, 'name': 'new vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, + 'close_time': self.tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy ', 'amount': 10}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -52,8 +52,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': tomorrow, 'name': 'new_vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, + 'close_time': self.tomorrow, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -67,8 +67,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': yesterday, 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy'}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, + 'close_time': self.yesterday, 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies = Vacancy.objects.count() @@ -81,8 +81,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': tomorrow, 'name': 'new_vacancy', + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, + 'close_time': self.tomorrow, 'name': 'new_vacancy', 'description': 'new_vacancy ', 'amount': 'sepuluh', 'salary':'dua juta'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -95,11 +95,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -109,11 +109,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'salary': 2, 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -126,11 +126,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time=self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -143,11 +143,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': yesterday, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.yesterday, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -157,11 +157,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': yesterday, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.yesterday, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'salary': 'dua juta'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -175,8 +175,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': today, - 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, + 'close_time': self.today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -204,14 +204,12 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - today = datetime.today() - - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': today, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.today, 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -222,8 +220,8 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' @@ -240,11 +238,11 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': today, 'close_time': tomorrow, + response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -258,8 +256,8 @@ class CreateAndUpdateVacancyTest(APITestCase): self.client.force_authenticate(user=superuser) url = '/api/vacancies/' - response = self.client.post(url, {'company': new_company.pk, 'open_time': yesterday, - 'close_time': today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') + response = self.client.post(url, {'company': new_company.pk, 'open_time': self.yesterday, + 'close_time': self.today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -277,7 +275,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': yesterday, 'close_time': today, + response = self.client.patch(url, {'open_time': self.yesterday, 'close_time': self.today, 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) -- GitLab From 88ffa33f5296c7b42e04034b3e6f4f27e561d8fb Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 15:42:51 +0700 Subject: [PATCH 16/21] fix error --- core/tests/test_create_vacancies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 310f64d..28cca07 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -54,7 +54,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new_vacancy', - 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy'}, format='json') + 'description': 'new_vacancy ', 'amount': 'sepuluh', 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() @@ -270,8 +270,8 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=today, - description="lalala", close_time=tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=self.today, + description="lalala", close_time=self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' -- GitLab From 200523ea1c3a15b64e40d2c2bbf8a93f62b665f1 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 16:37:04 +0700 Subject: [PATCH 17/21] fix error --- core/tests/test_create_vacancies.py | 35 +++++++++++++---------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 28cca07..4138dfd 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -23,7 +23,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, - 'close_time': self.tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy '}, format='json') + 'close_time': self.tomorrow, 'name': 'new vacancy', 'description': 'new_vacancy ', 'requirements': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancies = Vacancy.objects.count() @@ -38,7 +38,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new vacancy', - 'description': 'new_vacancy ', 'amount': 10}, format='json') + 'description': 'new_vacancy ', 'amount': 10, 'requirements': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() @@ -68,7 +68,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, - 'close_time': self.yesterday, 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy'}, format='json') + 'close_time': self.yesterday, 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy', 'requirements': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies = Vacancy.objects.count() @@ -83,7 +83,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new_vacancy', - 'description': 'new_vacancy ', 'amount': 'sepuluh', 'salary':'dua juta'}, format='json') + 'description': 'new_vacancy ', 'amount': 'sepuluh', 'salary':'dua juta', 'requirements': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies_count = Vacancy.objects.count() @@ -100,7 +100,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) def test_update_vacancy_with_amount_salary_success(self): @@ -114,7 +114,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'salary': 2, 'responsibilities': 'new_vacancy2'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'salary': 2, 'responsibilities': 'new_vacancy2', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() @@ -148,7 +148,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.yesterday, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_update_vacancy_with_amount_salary_string_failed(self): @@ -162,7 +162,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.yesterday, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'salary': 'dua juta'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'salary': 'dua juta', 'requirements': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() @@ -249,16 +249,15 @@ class CreateAndUpdateVacancyTest(APITestCase): vacancy = Vacancy.objects.first() self.assertEqual(vacancy.responsibilities, '') - def test_create_vacancy_with_open_time_before_today_failed(self): + def test_new_vacancy_with_open_time_before_today_failed(self): superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123') new_company = Company.objects.create(user=superuser, description="lalalaz", status=Company.VERIFIED, logo=None, address=None) self.client.force_authenticate(user=superuser) - + url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.yesterday, - 'close_time': self.today, 'name': 'new_vacancy', 'description': 'new_vacancy'}, format='json') - + 'close_time': self.today, 'name': 'new_vacancy', 'description': 'new_vacancy', 'responsibilities': 'new_vacancy', 'requirements': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancies = Vacancy.objects.count() @@ -270,14 +269,10 @@ class CreateAndUpdateVacancyTest(APITestCase): address=None) self.client.force_authenticate(user=superuser) - new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time=self.today, - description="lalala", close_time=self.tomorrow, name='new_company') + new_vacancy = Vacancy.objects.create(company=new_company, verified=False, open_time= self.today, + description="lalala", close_time= self.tomorrow, name='new_company') url = '/api/vacancies/' + str(new_vacancy.pk) + '/' - response = self.client.patch(url, {'open_time': self.yesterday, 'close_time': self.today, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - vacancy = Vacancy.objects.first() - self.assertEqual(vacancy.amount, None) \ No newline at end of file + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'requirements': 'new_vacancy2'}, format='json') + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) \ No newline at end of file -- GitLab From 71e0d3b36fde8c8db590ccd7674aa3ff2c46f151 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 16:45:44 +0700 Subject: [PATCH 18/21] fix error --- core/tests/test_create_vacancies.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 4138dfd..9acd782 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -131,7 +131,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'responsibilities': 'new_vacancy2'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 10, 'responsibilities': 'new_vacancy2', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() @@ -210,7 +210,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.today, - 'name': 'new_vacancy2', 'description': 'new_vacancy2'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @@ -226,7 +226,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.fromtimestamp(0), - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'requirements': 'new_vacancy2'}, , format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() @@ -243,7 +243,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': self.today, 'close_time': self.tomorrow, - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'amount': 'sepuluh'}, format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'responsibilities': 'new_vacancy2', 'amount': 'sepuluh', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() -- GitLab From a3c84271cf39f7800024a9c5fedc5c9523dea6a4 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 16:51:13 +0700 Subject: [PATCH 19/21] Last fix error --- core/tests/test_create_vacancies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 9acd782..7b55870 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -226,7 +226,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' + str(new_vacancy.pk) + '/' response = self.client.patch(url, {'open_time': datetime.fromtimestamp(0), 'close_time': datetime.fromtimestamp(0), - 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'requirements': 'new_vacancy2'}, , format='json') + 'name': 'new_vacancy2', 'description': 'new_vacancy2', 'amount': 'sepuluh', 'requirements': 'new_vacancy2'}, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) vacancy = Vacancy.objects.first() -- GitLab From d012a95b60691bd35d258f92a1a99d029defc333 Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 17:01:00 +0700 Subject: [PATCH 20/21] fix failed test --- core/tests/test_create_vacancies.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 7b55870..8b12672 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -53,8 +53,8 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, - 'close_time': self.tomorrow, 'name': 'new_vacancy', - 'description': 'new_vacancy ', 'amount': 'sepuluh', 'responsibilities': 'new_vacancy'}, format='json') + 'close_time': self.tomorrow, 'name': 'new vacancy', + 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() -- GitLab From 9e7c8ab94ab17f8035e737a28dd2c31d3257854c Mon Sep 17 00:00:00 2001 From: Raden Fikri Date: Sat, 12 Oct 2019 17:07:35 +0700 Subject: [PATCH 21/21] fix failed test --- core/tests/test_create_vacancies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tests/test_create_vacancies.py b/core/tests/test_create_vacancies.py index 8b12672..c5c960f 100644 --- a/core/tests/test_create_vacancies.py +++ b/core/tests/test_create_vacancies.py @@ -54,7 +54,7 @@ class CreateAndUpdateVacancyTest(APITestCase): url = '/api/vacancies/' response = self.client.post(url, {'company': new_company.pk, 'open_time': self.today, 'close_time': self.tomorrow, 'name': 'new vacancy', - 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy'}, format='json') + 'description': 'new_vacancy ', 'amount': 10, 'responsibilities': 'new_vacancy', 'requirements':'new_vacancy'}, format='json') self.assertEqual(response.status_code, status.HTTP_200_OK) vacancy = Vacancy.objects.first() -- GitLab