File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed
Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 11from django .urls import reverse
22
33from mosquito_alert .geo .tests .factories import BoundaryFactory
4- from mosquito_alert .users .tests .factories import UserFactory
54
65from ..models import BoundaryAuthorization , BoundaryMembership
76from .factories import BoundaryAuthorizationFactory
@@ -13,13 +12,12 @@ def test_changelist(self, admin_client):
1312 response = admin_client .get (url )
1413 assert response .status_code == 200
1514
16- def test_add (self , admin_client , freezer ):
15+ def test_add (self , admin_client , freezer , user ):
1716 url = reverse ("admin:authorization_boundaryauthorization_add" )
1817 response = admin_client .get (url )
1918 assert response .status_code == 200
2019
2120 boundary = BoundaryFactory ()
22- user = UserFactory ()
2321
2422 response = admin_client .post (
2523 url ,
Original file line number Diff line number Diff line change 2222from mosquito_alert .individuals .tests .factories import IndividualFactory
2323from mosquito_alert .taxa .models import Taxon
2424from mosquito_alert .taxa .tests .factories import TaxonFactory
25- from mosquito_alert .users .tests .factories import UserFactory
2625from mosquito_alert .utils .tests .test_models import BaseTestObservableMixin , BaseTestTimeStampedModel
2726
2827from ..models import (
@@ -1115,9 +1114,8 @@ def test_on_delete_counters_are_updated(self, was_skipped):
11151114 assert photo_task .total_external == 0
11161115
11171116 # Meta
1118- def test_constraint_unique_user_by_task (self ):
1117+ def test_constraint_unique_user_by_task (self , user ):
11191118 task = PhotoIdentificationTaskFactory ()
1120- user = UserFactory ()
11211119 with pytest .raises (IntegrityError , match = r"unique constraint" ):
11221120 self .factory_cls .create_batch (size = 2 , user = user , task = task )
11231121
Original file line number Diff line number Diff line change 77from django .db .utils import IntegrityError
88from django .utils import timezone
99
10- from mosquito_alert .users .tests .factories import UserFactory
1110from mosquito_alert .utils .tests .test_models import AbstractDjangoModelTestMixin , BaseTestTimeStampedModel
1211
1312from ..models import Flag , FlagInstance , FlagModeratedModel
@@ -245,14 +244,13 @@ def test_flag_counter_decrease_after_delete(self):
245244 assert obj .flag .count == 10
246245
247246 # meta
248- def test_constraint_unique_flag_by_user_only_if_user_is_not_null (self ):
247+ def test_constraint_unique_flag_by_user_only_if_user_is_not_null (self , user ):
249248 flag = FlagFactory ()
250249
251250 # Case user is null -> NOT RAISE
252251 _ = self .factory_cls .create_batch (size = 2 , flag = flag , user = None )
253252
254253 # Case user is not null -> RAISE
255- user = UserFactory ()
256254 with pytest .raises (IntegrityError , match = r"unique constraint" ):
257255 self .factory_cls .create_batch (size = 2 , flag = flag , user = user )
258256
You can’t perform that action at this time.
0 commit comments