From b0e1a8fafc5395b5051a056e3805bc75fe70bcfb Mon Sep 17 00:00:00 2001 From: "madjid.asa" Date: Fri, 10 Jan 2025 11:52:18 +0100 Subject: [PATCH] fix test of duplicate --- lemarche/tenders/tests/test_models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lemarche/tenders/tests/test_models.py b/lemarche/tenders/tests/test_models.py index 4c9db2803..951f1039c 100644 --- a/lemarche/tenders/tests/test_models.py +++ b/lemarche/tenders/tests/test_models.py @@ -5,7 +5,7 @@ from django.apps import apps from django.contrib.gis.geos import Point from django.forms.models import model_to_dict -from django.test import RequestFactory, TestCase +from django.test import RequestFactory, TestCase, TransactionTestCase from django.utils import timezone from lemarche.networks.factories import NetworkFactory @@ -1081,9 +1081,9 @@ def test_edit_form_validate_submission_to_commercial_partners(self): self.assertTrue(tender_response.send_to_commercial_partners_only) -class TenderUtilsTest(TestCase): +class TenderUtilsTest(TransactionTestCase): @classmethod - def setUpTestData(cls): + def setUpClass(cls): cls.user_siae = UserFactory(kind=User.KIND_SIAE) cls.user_buyer = UserFactory(kind=User.KIND_BUYER) cls.siae_with_tender_1 = SiaeFactory(users=[cls.user_siae]) @@ -1105,6 +1105,7 @@ def test_duplicate(self): self.assertNotEqual(self.tender_with_siae.status, new_tender.status) self.assertEqual(self.tender_with_siae.sectors.count(), new_tender.sectors.count()) self.assertNotEqual(self.tender_with_siae.siaes.count(), new_tender.siaes.count()) + self.assertNotEqual(self.tender_with_siae.slug, new_tender.slug) class TenderUtilsFindAmountRangesTests(TestCase):