From 6143d4f4d278f5ead7a5a4d0c2abc5ee7d816859 Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Wed, 11 Sep 2024 17:34:33 +0500 Subject: [PATCH] fix: replace IntegrityError with ValidationError --- tests/test_models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index fb5c606..2fcdfd0 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -9,7 +9,6 @@ from django.conf import settings from django.core.exceptions import ValidationError -from django.db.utils import IntegrityError from django.test import TestCase from taxonomy.models import B2CJobAllowList, Industry, Job, JobPostings, SkillValidationConfiguration @@ -751,10 +750,10 @@ def tearDown(self): def test_model_obj_creation_with_course_and_org(self): """ - Verify that an `IntegrityError` is raised if user try to create a + Verify that an `ValidationError` is raised if user try to create a SkillValidationConfiguration with both course and organization. """ - with pytest.raises(IntegrityError) as raised_exception: + with pytest.raises(ValidationError) as raised_exception: factories.SkillValidationConfigurationFactory( course_key=self.courses[0].key, organization=self.courses[0].key.split('+')[0]