From f29dcebcf3517aba3379c3d3f8fc2f4c50f2f9f2 Mon Sep 17 00:00:00 2001 From: Manjurul Hoque Rumi Date: Thu, 10 Oct 2024 23:40:22 +0600 Subject: [PATCH] Updated test forms with vacancy field --- tests/jobsapp/test_forms.py | 8 +++++--- tests/jobsapp/test_models.py | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/jobsapp/test_forms.py b/tests/jobsapp/test_forms.py index e81a4bef..774783a7 100644 --- a/tests/jobsapp/test_forms.py +++ b/tests/jobsapp/test_forms.py @@ -1,6 +1,7 @@ -from datetime import datetime, timedelta -from http import HTTPStatus +from datetime import timedelta + from django.test import TestCase +from django.utils import timezone from accounts.models import User from jobsapp.forms import CreateJobForm @@ -13,11 +14,12 @@ def setUp(self) -> None: self.valid_job = { "title": "Junior Software Engineer", "description": "Looking for Python developer", + "vacancy": 2, "salary": 35000, "location": "Dhaka, Bangladesh", "type": "1", "category": "web-development", - "last_date": datetime.now() + timedelta(days=30), + "last_date": timezone.now() + timedelta(days=30), "company_name": "Dev Soft", "company_description": "A foreign country", "website": "www.devsoft.com", diff --git a/tests/jobsapp/test_models.py b/tests/jobsapp/test_models.py index 0e8121f7..00bb5374 100644 --- a/tests/jobsapp/test_models.py +++ b/tests/jobsapp/test_models.py @@ -1,7 +1,7 @@ -from datetime import datetime, timedelta +from datetime import timedelta from django.test import TestCase -from django.utils import translation +from django.utils import translation, timezone from accounts.models import User from jobsapp.models import Applicant, Job @@ -20,7 +20,7 @@ def setUpTestData(cls) -> None: "location": "Dhaka, Bangladesh", "type": "1", "category": "web-development", - "last_date": datetime.now() + timedelta(days=30), + "last_date": timezone.now() + timedelta(days=30), "company_name": "Dev Soft", "company_description": "A foreign country", "website": "www.devsoft.com",