Skip to content

Commit

Permalink
fix: replace IntegrityError with ValidationError
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Sep 11, 2024
1 parent 925c4fa commit 6143d4f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 6143d4f

Please sign in to comment.