19 lines
2.9 KiB
Python
19 lines
2.9 KiB
Python
from http_common import *
|
|
manager=login('manager');owner=session('owner');anon=session();top='0ae14c9a-1adb-4ee7-8094-d5d54d4e75f1';admin='/api/v2/investment/admin/zones/'
|
|
before=call(manager,admin+top)['record'];suspended=call(manager,admin+top+'/suspend',{'version_no':before['version_no']})
|
|
check('explicit_suspend_coexists_with_draft',suspended['publication_status']=='suspended' and suspended['version_no']==8 and suspended['public_version_no']==9 and suspended['resources']==before['resources'])
|
|
call(anon,'/api/v2/investment/zones/'+top,expected=404)
|
|
call(manager,admin+top+'/publish',{'version_no':8},expected=409);check('changed_base_publish_refused_preserves_both',True)
|
|
reconciled=call(manager,admin+top+'/reconcile',{'version_no':8,'base_public_version':9});check('explicit_reconcile_only_private_base',reconciled['version_no']==10 and reconciled['base_public_version']==9 and reconciled['publication_status']=='suspended' and reconciled['resources']==before['resources'])
|
|
published=call(manager,admin+top+'/publish',{'version_no':10});check('republish_after_explicit_reconcile_no_revision_collision',published['version_no']==11 and published['publication_status']=='published')
|
|
view=call(owner,'/investimentos/'+json.loads((out/'CONTEXTO-QA.json').read_text('utf-8'))['existing_case']);check('consulted_version_5_preserved_after_public_11',view['zone_contexts'][0]['consulted_public_version']==5)
|
|
other='b3e162da-0f9e-4ed4-8e66-c1febcb8504b';case_before=call(owner,'/investimentos/'+other)
|
|
call(owner,f'/investimentos/{other}/parques',{'version':case_before['case']['version'],'zone_id':top,'consulted_public_version':5,'confirm':True},expected=409)
|
|
case_after=call(owner,'/investimentos/'+other);check('changed_consulted_version_visible_409_dossier_unchanged',case_before==case_after)
|
|
path='/management/investment/zones/profile-install';installer=login('installer');p=call(installer,path)['plan'];payload={'hash':p['hash'],'idempotency_key':str(uuid.uuid4()),'confirm':True}
|
|
call(installer,path,payload,expected=419,headers={'X-XSRF-TOKEN':'invalid'});check('installer_CSRF_preserved',True)
|
|
receipt=call(installer,path,payload)['receipt'];check('final_candidate_installer_exact_fingerprint_noop',not receipt['changed'] and receipt['code_hash']==p['code_hash'])
|
|
public=call(anon,'/api/v2/investment/zones/'+top);check('final_public_private_support_note_not_disclosed','QA-T1-PRIVADO-PRESERVAR' not in json.dumps(public) and 'support_document_ids' not in json.dumps(public))
|
|
(out/'COEXISTENCIA-QA.json').write_text(json.dumps({'private_before':8,'suspended_public':9,'reconciled_private':10,'final_public':11,'consulted_dossier_version':5,'reconciliation':'Explicit technical base comparison, no automatic publication','final_code_hash':receipt['code_hash'],'migration':receipt['migration'],'active_changes':0},ensure_ascii=False,indent=2),'utf-8')
|
|
print(json.dumps({'checks':len(proof['checks']),'events':len(proof['events']),'final_public':11,'dossier_consulted':5}))
|