20 lines
2.3 KiB
Python
20 lines
2.3 KiB
Python
from http_common import *
|
|
import copy
|
|
manager=session('manager');owner=session('owner');reviewer=session('reviewer');anon=session()
|
|
cp='/minhas-oportunidades/15';current=call(reviewer,cp+'/classification')
|
|
for row in list(current['rows']):
|
|
if row['state']=='confirmed':continue
|
|
current=call(reviewer,cp+'/classification/review',{'etag':current['etag'],'hash':row['hash'],'state':'confirmed','reason':'Decisão sintética QA para observar preservação após reversão compatível.'})
|
|
check('secondary_canonical_decisions_ready_for_old_edit',len(current['rows'])==3 and all(x['state']=='confirmed' for x in current['rows']))
|
|
original=json.loads((private/'business-positive.json').read_text('utf-8'));endpoint='/api/v1/existing-business/listings/'+f['business_id']+'/classification'
|
|
r,_=operation(manager,'withdraw');check('explicit_withdrawal_retains_immutable_CAE_nodes',len(r['changed'])==9 and len(r['reused'])==6)
|
|
check('withdrawn_CAE_unavailable_to_new_choices',not call(anon,'/api/v1/catalogs/economic-activities?origin=cae')['data'])
|
|
check('business_withdrawn_references_leave_public_projection',call(anon,'/negocios/'+f['business_slug'])['data']['multidimensional']==[])
|
|
check('canonical_withdrawn_references_leave_public_projection',call(anon,'/api/v1/investment/opportunities/inv-mz-gen-5673010729603343')['context']['classification']==[])
|
|
current=call(owner,endpoint)['supplement'];payload={'action':'prepare','version_no':current['version_no'],'rows':original['rows'],'reason':'Manter exatamente a relação histórica após retirada das referências QA.'}
|
|
call(owner,endpoint,payload);check('business_exact_historical_relations_retained',True)
|
|
current=call(owner,endpoint)['supplement'];forged=copy.deepcopy(original['rows']);forged[2]['classification']['criteria']+=' Alterado.'
|
|
call(owner,endpoint,{**payload,'version_no':current['version_no'],'rows':forged},expected=422);check('withdrawn_reference_cannot_be_reintroduced_as_changed_relation',True)
|
|
current=call(owner,cp+'/classification');call(owner,cp+'/draft',{'canonical':{'sector_id':2},'etag':current['etag'],'reason':'Ensaio QA da recusa de nova taxonomia em referência retirada.'},method='PUT',expected=422);check('withdrawn_taxonomy_cannot_be_changed_then_laundered_on_submission',True)
|
|
print(json.dumps({'checks':len(proof['checks']),'phase':'withdrawal retained history complete'}))
|