@@ -1249,6 +1249,7 @@ def test_cannot_submit_more_than_3_proposals(graphql_client, user):
12491249 active_cfp = True ,
12501250 durations = ("50" ,),
12511251 audience_levels = ("Beginner" ,),
1252+ max_proposals_per_user = 3 ,
12521253 )
12531254
12541255 SubmissionFactory (
@@ -1267,14 +1268,53 @@ def test_cannot_submit_more_than_3_proposals(graphql_client, user):
12671268 status = Submission .STATUS .proposed ,
12681269 )
12691270
1270- resp , _ = _submit_talk (graphql_client , conference , title = {"en" : "My first talk" })
1271+ resp , _ = _submit_talk (
1272+ graphql_client , conference , title = {"en" : "My first talk" }, languages = ["en" ]
1273+ )
12711274
12721275 assert resp ["data" ]["sendSubmission" ]["__typename" ] == "SendSubmissionErrors"
12731276 assert resp ["data" ]["sendSubmission" ]["errors" ]["nonFieldErrors" ] == [
12741277 "You can only submit up to 3 proposals"
12751278 ]
12761279
12771280
1281+ def test_can_submit_unlimited_proposals_when_max_proposals_is_none (
1282+ graphql_client , user
1283+ ):
1284+ graphql_client .force_login (user )
1285+
1286+ conference = ConferenceFactory (
1287+ topics = ("my-topic" ,),
1288+ languages = ("en" , "it" ),
1289+ submission_types = ("talk" ,),
1290+ active_cfp = True ,
1291+ durations = ("50" ,),
1292+ audience_levels = ("Beginner" ,),
1293+ # max_proposals_per_user defaults to None (no limit)
1294+ )
1295+
1296+ EmailTemplateFactory (
1297+ conference = conference ,
1298+ identifier = EmailTemplateIdentifier .proposal_received_confirmation ,
1299+ )
1300+
1301+ # Create 3 existing submissions
1302+ for _ in range (3 ):
1303+ SubmissionFactory (
1304+ speaker_id = user .id ,
1305+ conference = conference ,
1306+ status = Submission .STATUS .proposed ,
1307+ )
1308+
1309+ # Should be able to submit a 4th proposal
1310+ resp , _ = _submit_talk (
1311+ graphql_client , conference , title = {"en" : "My fourth talk" }, languages = ["en" ]
1312+ )
1313+
1314+ assert resp ["data" ]["sendSubmission" ]["__typename" ] == "Submission"
1315+ assert resp ["data" ]["sendSubmission" ]["title" ] == "My fourth talk"
1316+
1317+
12781318def test_submit_talk_with_do_not_record_true (graphql_client , user ):
12791319 graphql_client .force_login (user )
12801320
0 commit comments