From 9774d301ef82ccf3a97fcc66368df5daa0154a68 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Sun, 9 May 2021 15:29:09 +0900 Subject: [PATCH] Update test_models.py --- backend/api/tests/test_models.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/api/tests/test_models.py b/backend/api/tests/test_models.py index a5a67bcf..51e2f705 100644 --- a/backend/api/tests/test_models.py +++ b/backend/api/tests/test_models.py @@ -92,7 +92,10 @@ class TestLabel(TestCase): label = Label(project=project, text='example', suffix_key='a') - label.full_clean() + try: + label.full_clean() + except ValidationError: + self.fail(msg=ValidationError) def test_can_add_label_suffix_key_with_prefix_key(self): project = mommy.make('Project') @@ -100,7 +103,10 @@ class TestLabel(TestCase): text='example', prefix_key='ctrl', suffix_key='a') - label.full_clean() + try: + label.full_clean() + except ValidationError: + self.fail(msg=ValidationError) class TestDocumentAnnotation(TestCase):