File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 66from helpers .constants import GENDERS
77from users .tests .factories import UserFactory
88from countries import countries
9+ from participants .tests .factories import ParticipantFactory
10+ from participants .models import Participant
911
1012
1113class GrantFactory (DjangoModelFactory ):
@@ -34,3 +36,14 @@ class Meta:
3436 github_handle = factory .Faker ("user_name" )
3537 linkedin_url = factory .Faker ("user_name" )
3638 mastodon_handle = factory .Faker ("user_name" )
39+
40+ @classmethod
41+ def _create (self , model_class , * args , ** kwargs ):
42+ grant = super ()._create (model_class , * args , ** kwargs )
43+
44+ if not Participant .objects .filter (
45+ user_id = grant .user .id , conference = grant .conference
46+ ).exists ():
47+ ParticipantFactory (user_id = grant .user .id , conference = grant .conference )
48+
49+ return grant
You can’t perform that action at this time.
0 commit comments