接通审核中结果核对、受理记账与后续调度
This commit is contained in:
1 parent
d157c179c8
commit
f0be4f5596
18 files changed
+510
-57
No files matched your search
@@ -84,5 +84,24 @@ class ControllerTests(unittest.TestCase):
|
||||
self.assertIsNone(store.run['active'])
|
||||
|
||||
|
||||
def test_ui_historical_result_reconciliation(self):
|
||||
store = self.controller.store
|
||||
store.enqueue(ROOT / 'test/fixtures/article')
|
||||
store.configure(dict(fid=125, minimum=1, maximum=1, interval=0, history_checked=True))
|
||||
store.control('start')
|
||||
job = store.next(dict(owner='tab-a', account=dict(uid='123', name='测试账号')))['job']
|
||||
for state in ('importing','formatting','awaiting_user_review','user_submitting'):
|
||||
store.event(dict(owner='tab-a',id=job['id'],state=state,epoch=store.run['epoch'],snapshot={'title':job['title']}))
|
||||
store.control('stop')
|
||||
data=dict(id=job['id'],article_key=job['article_key'],confirmed=True,thread_id='236999',first_post_pid='238791',
|
||||
post_url='https://www.dww11.com/thread/23699911.html',title=job['title'],author_uid='123',fid=125,
|
||||
state='accepted_pending_moderation',evidence={'thread_id':'236999'})
|
||||
with self.assertRaises(HTTPError):
|
||||
self.request('/api/reconcile',data,token=self.controller.bridge_token)
|
||||
self.assertEqual(self.request('/api/reconcile',data,token=self.controller.ui_token)[0],200)
|
||||
self.assertEqual(store.run['batch']['count'],0)
|
||||
self.assertFalse(store.run['running'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user