Skip to content

Commit

Permalink
update tests for marking sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed May 8, 2024
1 parent 597047b commit 680e0ae
Show file tree
Hide file tree
Showing 14 changed files with 865 additions and 44 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
with:
use_dev_image: false
run: |
mkdir -p data
mkdir -p applogs
script/bootstrap
script/test --coverage
Expand Down
17 changes: 17 additions & 0 deletions crowdsourcer/fixtures/assignments.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"model": "crowdsourcer.assigned",
"pk": 1,
"fields": {
"marking_session": 1,
"user": 2,
"section": 1,
"authority": 1,
Expand All @@ -15,6 +16,7 @@
"model": "crowdsourcer.assigned",
"pk": 2,
"fields": {
"marking_session": 1,
"user": 2,
"section": 2,
"authority": 2,
Expand All @@ -27,6 +29,7 @@
"model": "crowdsourcer.assigned",
"pk": 3,
"fields": {
"marking_session": 1,
"user": 2,
"section": 2,
"authority": 3,
Expand All @@ -39,12 +42,26 @@
"model": "crowdsourcer.assigned",
"pk": 4,
"fields": {
"marking_session": 1,
"user": 4,
"section": 2,
"authority": 2,
"response_type": 3,
"active": true,
"question": null
}
},
{
"model": "crowdsourcer.assigned",
"pk": 5,
"fields": {
"marking_session": 2,
"user": 5,
"section": 22,
"authority": 2,
"response_type": 1,
"active": true,
"question": null
}
}
]
6 changes: 6 additions & 0 deletions crowdsourcer/fixtures/audit_assignments.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"model": "crowdsourcer.assigned",
"pk": 1,
"fields": {
"marking_session": 1,
"user": 2,
"section": 1,
"authority": 1,
Expand All @@ -15,6 +16,7 @@
"model": "crowdsourcer.assigned",
"pk": 2,
"fields": {
"marking_session": 1,
"user": 2,
"section": 2,
"authority": 2,
Expand All @@ -27,6 +29,7 @@
"model": "crowdsourcer.assigned",
"pk": 3,
"fields": {
"marking_session": 1,
"user": 2,
"section": 2,
"authority": 3,
Expand All @@ -39,6 +42,7 @@
"model": "crowdsourcer.assigned",
"pk": 4,
"fields": {
"marking_session": 1,
"user": 2,
"section": 3,
"authority": 4,
Expand All @@ -50,6 +54,7 @@
"model": "crowdsourcer.assigned",
"pk": 5,
"fields": {
"marking_session": 1,
"user": 2,
"section": 3,
"authority": 3,
Expand All @@ -61,6 +66,7 @@
"model": "crowdsourcer.assigned",
"pk": 6,
"fields": {
"marking_session": 1,
"user": 2,
"section": 4,
"authority": 3,
Expand Down
22 changes: 22 additions & 0 deletions crowdsourcer/fixtures/audit_second_session_marks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"model": "crowdsourcer.response",
"pk": 2000,
"fields": {
"authority": 1,
"question": 2002,
"user": 2,
"option": 20021,
"response_type": 3,
"public_notes": "public notrs",
"page_number": "0",
"evidence": "",
"private_notes": "private notes",
"revision_type": null,
"revision_notes": null,
"created": "2023-03-15T17:22:10+0000",
"last_update": "2023-03-15T17:22:10+0000",
"multi_option": []
}
}
]
41 changes: 41 additions & 0 deletions crowdsourcer/fixtures/basics.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,94 @@
[
{
"model": "crowdsourcer.markingsession",
"pk": 1,
"fields": {
"label": "Default",
"start_date": "2023-03-01",
"active": true
}
},
{
"model": "crowdsourcer.markingsession",
"pk": 2,
"fields": {
"label": "Second Session",
"start_date": "2023-03-01",
"active": true
}
},
{
"model": "crowdsourcer.section",
"pk": 1,
"fields": {
"marking_session": 1,
"title": "Buildings & Heating"
}
},
{
"model": "crowdsourcer.section",
"pk": 2,
"fields": {
"marking_session": 1,
"title": "Transport"
}
},
{
"model": "crowdsourcer.section",
"pk": 3,
"fields": {
"marking_session": 1,
"title": "Planning & Land Use"
}
},
{
"model": "crowdsourcer.section",
"pk": 4,
"fields": {
"marking_session": 1,
"title": "Governance & Finance"
}
},
{
"model": "crowdsourcer.section",
"pk": 5,
"fields": {
"marking_session": 1,
"title": "Biodiversity"
}
},
{
"model": "crowdsourcer.section",
"pk": 6,
"fields": {
"marking_session": 1,
"title": "Collaboration & Engagement"
}
},
{
"model": "crowdsourcer.section",
"pk": 7,
"fields": {
"marking_session": 1,
"title": "Waste Reduction & Food"
}
},
{
"model": "crowdsourcer.section",
"pk": 21,
"fields": {
"marking_session": 2,
"title": "Second Session Section"
}
},
{
"model": "crowdsourcer.section",
"pk": 22,
"fields": {
"marking_session": 2,
"title": "Transport"
}
},
{
"model": "crowdsourcer.questiongroup",
"pk": 1,
Expand Down
5 changes: 5 additions & 0 deletions crowdsourcer/fixtures/ca_sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,39 @@
"model": "crowdsourcer.section",
"pk": 8,
"fields": {
"marking_session": 1,
"title": "Buildings & Heating & Green Skills (CA)"
}
},
{
"model": "crowdsourcer.section",
"pk": 9,
"fields": {
"marking_session": 1,
"title": "Transport (CA)"
}
},
{
"model": "crowdsourcer.section",
"pk": 10,
"fields": {
"marking_session": 1,
"title": "Planning & Biodiversity (CA)"
}
},
{
"model": "crowdsourcer.section",
"pk": 11,
"fields": {
"marking_session": 1,
"title": "Governance & Finance (CA)"
}
},
{
"model": "crowdsourcer.section",
"pk": 12,
"fields": {
"marking_session": 1,
"title": "Collaboration & Engagement (CA)"
}
}
Expand Down
40 changes: 40 additions & 0 deletions crowdsourcer/fixtures/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,5 +698,45 @@
"description": "None",
"ordering": 3
}
},
{
"model": "crowdsourcer.option",
"pk": 20011,
"fields": {
"question": 2001,
"score": 1,
"description": "Section Session Section Q1 Opt 1",
"ordering": 1
}
},
{
"model": "crowdsourcer.option",
"pk": 20012,
"fields": {
"question": 2001,
"score": 1,
"description": "Section Session Section Q1 Opt 2",
"ordering": 2
}
},
{
"model": "crowdsourcer.option",
"pk": 20021,
"fields": {
"question": 2002,
"score": 1,
"description": "Section Session Transport Q1 Opt 1",
"ordering": 1
}
},
{
"model": "crowdsourcer.option",
"pk": 20022,
"fields": {
"question": 2002,
"score": 2,
"description": "Section Session Transport Q1 Opt 2",
"ordering": 2
}
}
]
44 changes: 44 additions & 0 deletions crowdsourcer/fixtures/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,49 @@
4
]
}
},
{
"model": "crowdsourcer.question",
"pk": 2001,
"fields": {
"number": 1,
"number_part": null,
"description": "Second Session Section One Q1",
"criteria": "Second Session Criteria",
"section": 21,
"clarifications": "Second Session clarification",
"topic": "",
"weighting": "low",
"how_marked": "volunteer",
"question_type": "select_one",
"questiongroup": [
1,
2,
3,
4
]
}
},
{
"model": "crowdsourcer.question",
"pk": 2002,
"fields": {
"number": 1,
"number_part": null,
"description": "Second Session Transport Q1",
"criteria": "Second Session Criteria",
"section": 22,
"clarifications": "Second Session clarification",
"topic": "",
"weighting": "low",
"how_marked": "volunteer",
"question_type": "select_one",
"questiongroup": [
1,
2,
3,
4
]
}
}
]
Loading

0 comments on commit 680e0ae

Please sign in to comment.