-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix error when ingesting cancelled event with assignments (#2093)
it was checking session data which failed during ingest STTNHUB-361
- Loading branch information
Showing
8 changed files
with
67 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from flask import request | ||
from planning.tests import TestCase | ||
from planning.common import update_post_item | ||
|
||
|
||
class IngestCancelledTestCase(TestCase): | ||
def test_ingest_cancelled_event(self): | ||
assert not request, request | ||
|
||
assignments = [ | ||
{"planning_item": "p1", "coverage_item": "c1"}, | ||
] | ||
|
||
self.app.data.insert("assignments", assignments) | ||
planning = { | ||
"_id": "p1", | ||
"name": "planning item", | ||
"type": "planning", | ||
"coverages": [ | ||
{ | ||
"coverage_id": "c1", | ||
"planning": {}, | ||
"assigned_to": { | ||
"assignment_id": assignments[0]["_id"], | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
self.app.data.insert("planning", [planning]) | ||
|
||
with self.app.app_context(): | ||
update_post_item({"pubstatus": "cancelled"}, planning) | ||
|
||
cursor, count = self.app.data.find("assignments", req=None, lookup={}) | ||
assert count == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters