Skip to content

Commit 1bac783

Browse files
committed
Bind synthetic publisher module to test-scoped validated feed source; retain real integrity validation
1 parent 3a8aafa commit 1bac783

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/test_publication_manual_handoff.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_stale_automatic_selection_does_not_send_after_owner_handoff(self):
182182
self.existing(db)
183183
common.set_setting(db,"auto_enabled","1")
184184
with common.connect() as db:
185-
self.assertIsNotNone(worker.load_record(RID))
185+
self.assertIsNotNone(common.load_record(RID))
186186
self.assertEqual(db.execute("SELECT approval_sha256,post_id,draft_comment "
187187
"FROM publish_jobs WHERE run_id=?",(RID,)).fetchone(),
188188
(self.record["approval_sha256"],PID,self.record["draft_comment"]))
@@ -197,6 +197,7 @@ def get_then_approve(method,path,*args,**kwargs):
197197
return {"post":{"id":PID}}
198198
with common.connect() as db, \
199199
patch.object(worker,"auto_candidates",return_value=0), \
200+
patch.object(worker,"load_record",side_effect=common.load_record), \
200201
patch.object(worker,"allow_auto_candidate",return_value=True), \
201202
patch.object(worker,"checkpoint"), \
202203
patch.object(worker,"can_send",return_value=(True,"")), \
@@ -215,7 +216,7 @@ def test_existing_manual_publisher_path_claims_one_send(self):
215216
self.approve(db)
216217
common.queue_manual(db,RID)
217218
with common.connect() as db:
218-
self.assertIsNotNone(worker.load_record(RID))
219+
self.assertIsNotNone(common.load_record(RID))
219220
self.assertEqual(db.execute("SELECT approval_sha256,post_id,draft_comment "
220221
"FROM publish_jobs WHERE run_id=?",(RID,)).fetchone(),
221222
(self.record["approval_sha256"],PID,self.record["draft_comment"]))
@@ -227,6 +228,7 @@ def stub(method,path,*args,**kwargs):
227228
return {"success":True,"comment":{"id":"11111111-2222-3333-4444-555555555555"}}
228229
with common.connect() as db, \
229230
patch.object(worker,"auto_candidates",return_value=0), \
231+
patch.object(worker,"load_record",side_effect=common.load_record), \
230232
patch.object(worker,"checkpoint"), \
231233
patch.object(worker,"can_send",return_value=(True,"")), \
232234
patch.object(worker,"api",side_effect=stub), \

0 commit comments

Comments
 (0)