From 28a5d92e822ab5c3d062f1ff80135f3010acf1de Mon Sep 17 00:00:00 2001 From: Sushil Tiwari Date: Thu, 21 Nov 2024 12:52:40 +0545 Subject: [PATCH] Add dummydata for project csv api snapshot test --- deployments/snapshots/snap_tests.py | 20 ++++++------- deployments/tests.py | 45 ++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/deployments/snapshots/snap_tests.py b/deployments/snapshots/snap_tests.py index 164426fcc..f78e1c102 100644 --- a/deployments/snapshots/snap_tests.py +++ b/deployments/snapshots/snap_tests.py @@ -336,16 +336,16 @@ snapshots[ "TestProjectAPI::test_project_csv_api 1" ] = """actual_expenditure,budget_amount,description,document,dtype,dtype_detail.id,dtype_detail.name,dtype_detail.summary,dtype_detail.translation_module_original_language,end_date,event,event_detail.dtype,event_detail.emergency_response_contact_email,event_detail.id,event_detail.name,event_detail.parent_event,event_detail.slug,event_detail.start_date,event_detail.translation_module_original_language,id,modified_at,modified_by,modified_by_detail,name,operation_type,operation_type_display,primary_sector,primary_sector_display,programme_type,programme_type_display,project_country,project_country_detail.id,project_country_detail.iso,project_country_detail.iso3,project_country_detail.name,project_country_detail.society_name,project_districts_detail.code,project_districts_detail.id,project_districts_detail.is_deprecated,project_districts_detail.is_enclave,project_districts_detail.name,reached_female,reached_male,reached_other,reached_total,regional_project,regional_project_detail.created_at,regional_project_detail.id,regional_project_detail.modified_at,regional_project_detail.name,regional_project_detail.translation_module_original_language,regional_project_detail.translation_module_skip_auto_translation,reporting_ns,reporting_ns_contact_email,reporting_ns_contact_name,reporting_ns_contact_role,reporting_ns_detail.id,reporting_ns_detail.iso,reporting_ns_detail.iso3,reporting_ns_detail.name,reporting_ns_detail.society_name,secondary_sectors,secondary_sectors_display,start_date,status,status_display,target_female,target_male,target_other,target_total,translation_module_original_language,translation_module_skip_auto_translation,user,visibility,visibility_display\r -0,3070000,,,3,3,disaster-type-zjivfEKVdJzqfzGBXSiWiEJmFzPKmJNVHpperXBuRKfhQABxwm,uwMPbXtkwNZCNjCcomRxjWUfhVdpNjsavSZhtCEbvnVInnIHWqJENUjSSQbyLQHcqkdsmYSNrdDPaeyQrQQxgbsPyoyGTguFMIflmGDJTbcpHtvFzVkbwRwwOtpGrZdOqybJrojvzQifUyHRNORoApKjBtMvCIinPiLIRZmitSTHiBXjPKkueJIUhlujUbWuAAtCVOVrjXmgilbWNNrMKNoMooRbwfSXEiGMETPxlyFEikmocAWarAoVQmWnelCNFSuDpBzXcMVyUuzNVKMIHPTYcHgCDcpHIzVcJyHWOdmsCztXsDkBsNdSHjDPCfUGhlXLSIizAuCblDLTmDfquSPTYkTUhfhTCOxfHTyUYGNkyJycXkvKQjkjlXTdAttUXCsOlhimaNWqaDFFIZaMFpnLQEDACfMMapJrNOJndljdPwcjcQKMtvfdgAlkRsNQSSMKYJlDVLxcfXtuxyeWBJesEihSrvHAHnSnNdgKUOHfEUSMYTsB,en,2008-01-01,2,1,,2,event-silUaSKzXKclMuZNoOKgFjvVepwukOfTQOUvCaqnpSewqYgUad,1,ycuakafywiygeykpwrokcezcsbuqgevkykuejfvmnetbbpkmbk,,en,1,2008-01-01T00:00:00.123456Z,,,project-MuqHKNwiNKFHUOFFZlNoTsmahbDOYhVnZNAAcvwJZOnaOmSsqY,1,Emergency Operation,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,0,Bilateral,3,3,gZ,UEW,country-mdryRMMcemZWLUQJnEnvtanmVhVWEpSMTnzpJuXsyDIPwtqxGF,society-name-unxuAcKoVjbqJLLUAsjmvoyKpFJPRvqWFUPVFDkUYwkiUIFlIP,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-vREEZcPiEjODIvDYAVdHtKURuJIbnKRvZYwejrbvyOIkKMylMh,en,False,2,,,,2,Mf,djk,country-WrKoZBJXNNRPJbMQSrblrSWtvwaljKQzejVObfVHnyADvkxtUu,society-name-WNdRfrCQBFMCArnWGhwBhsRRLFHQtcozMdantnXiWqsuhaFVBl,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r -0,7190000,,,6,6,disaster-type-xVZxVXLHMxpPrnLyfgiOVMhcLPmmTCgeINvtUEWmIUjcimAJTq,WJwxCOThBeEAHGYbkMrSiscKdYSmVzFRIGekCWGyJXyzMrnlakKnLSaYGDGTUHqtosTrJhkocIpscOjrirYdPpnIhaPwOMxufTJqUiANsudOawoUrlqbIQXXLgUVSyPqOOMJnCournLOZWzjCoUUBxjEfFlDllmKFUlPsbtklzRMmejeBpDPzgUHiUWZaMgyybhaWPcipXfrjOMaYaYgIVvTfmiEWKCktvEjpdISrOIhbcgIsgGAjaoboByjwPsoRyRThFkhogsweNvhxfcMjlBHvMlRBjQRtNswgrFQxqZTZeYajXPjujyCUYYEehKBUrjfuilXywuFBESAMYOviZPpyAJFIIFIIoyfLTAHKXSZVoSfpxanbxJEihdwxXisDjJApnodVihSTjyUbSBxdSgQLeEMkbjxjfpeaKAjWlEViVHStEAUvCYPSashjdPcMWlGkazBRDJTqKGtToBkrfHyiVnzNdozlVJMeSDEuPPzykdZxPBm,en,2008-01-01,4,4,,4,event-fvuzXkBdzWcQPjKdOTZQHsAzRSJtUVuwarHNjSzCPnINYNPCSw,3,zypzxmtfcivyuuvihisnfgjthvwokbbyilqpxtubghudxqogwh,,en,2,2008-01-01T00:00:00.123456Z,,,project-rggexMXvbpskIgenMaWtmJmOcprfKKcKYEcduftawWszGmuWzU,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,1,Multilateral,5,5,gI,Lwj,country-REShxGUKbqkLdjuDSiwkdrxAOwdssHOeGmXOlWgMWkIuuRZtrR,society-name-aiHsxXFAvkgnjGomYJNSHITJSWZhADehibEwtSxiCMHWvlTtbV,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,2,2008-01-01T00:00:00.123456Z,2,2008-01-01T00:00:00.123456Z,regional-project-kjRDfOfTonZRPjXTkGHUMPHXvCYivsxNBcTXRypnNMejKOFgZa,en,False,4,,,,4,at,cRM,country-uTcrAfFpxCtnHtlhxYcXmfCGbZEGjmvEUHtXujXgHRinUcDyTH,society-name-fvDcgHXQVtbKWtOnummsrIuXCQhrjkrhaNJGgnIwJurjTZsKpk,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,6,public,Public\r -0,7760000,,,9,9,disaster-type-jhYQmOusTYYfwMZFbNLAkxqmGrHbFukdPpStqCBvcrVWQDQfvJ,ciNaVKbtymEyycSRrSyvxZGYBATviwUqJmFsrfCQfZQuGhbZiZWgpelxejKZpXfeaUaVZvNejLODOvYQgNhdTimVflfTfaBYRondTfyuOHmEmTFMTlEsURLdClGaflmqjIKmShSWemluWokzOLsMAGOsnBqwVpHaPRqsWkedeFwUdNWBfRWTCaVRfuLXxSRMReKqUuCwVZExFtWFuIVmoLkcSwADDuYzDDCjjVWyAbiYuyOjzxaBYQljLlngbzEjrvmbFzktJromFMUFBBkFQdwgeuTEMsjpHFZnAFatOkvOtRNBNhMiHsvUxZSixKEebCxApnuSouOEYrJvKYvSmiuYOKoTLNppFKEbuGgyWjNufHFDMUreCyXmYXrTjxXdEpoOauwNEJjYruFuMImZPmMMhsUdVmHZGspYyBSatqnjsbbPPWAfxDXjCOyJkMCWugrDrmTMDskLiubhduJExjuUyJbOBPuzluNWcPsuKWKcGdUTTiFe,en,2008-01-01,6,7,,6,event-nDqchHQOlEiDLuxKyQLcuSgOwakAEvvPglwtkDIlWbCZNDLKSB,5,uzepquxmverztcowggabxrkzlbkgktmshmkwiiqvydftyxjzwd,,en,3,2008-01-01T00:00:00.123456Z,,,project-eijgHkTpfWxwvfAvWeFzIdHAPYzSjJfnCkhWqopdPRJbdPSoEc,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,0,Bilateral,7,7,we,AMV,country-osqyTwekseIKpHNGtzNdIShLEqPbcvAqmvWdinJUvWQdpFeZKN,society-name-NfJEirUcgcFGoPwBEtYobdbXYZmIMyRRVbJEdyXySiBSBJihCh,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,3,2008-01-01T00:00:00.123456Z,3,2008-01-01T00:00:00.123456Z,regional-project-bQTSAJecmLcnoLFawSfLxGkznjIaOVNsrJxGykmWMqvmuqzhPs,en,False,6,,,,6,Rc,NPd,country-ZYfFgDukskerKxwfelTXDqEqWCPihKFcxszANRiCxGNuxfRAGC,society-name-VYpSJajgsykKzeoyDQfwDDPIDgflUgzXBmzveuvMFnSVEhrDcI,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,7,public,Public\r -0,100000,,,12,12,disaster-type-olabeSHyDByhcbGOMQJZRETyhaJfsmxyYfsdUpJsuPpPfLGWdY,ErAYWXJPimutALuRYgcamUXbDWzlaxrvVLyCevbScBBQyBrfeaPzxtfTfTosaZCIugzNLrXNEcHNaxXJWmBAJmsJjyIUKKNzkyMDYaHoIBJJHOKhEHRQPFYNexbxZLBlxDeKDybSMpibfiBSWwDOHKJlyatfJaWKxieYDxvGuhDFDsTfQViFsyMlYegIRZPJjrfMTLziBrlkjMEvGLeCdZTqUUxrigJwRsxFcuBXGiaKjixFaTKbUdeOzoTvArdDknirElGkJNuUYradfFHPHlkSqTCpfiAeyIYXxaEedYwJPSWdfhKxaNlDZgQfulBfVcVxoYCdKimccDeZBLuRaaEqSPfGKYtJTuSsoZPjZKHDALJKnAwiMqrEXhAUfNYUGjEmZtZIfnXUXecqvcjwXJQNzoRleDsnYYUxCqHWpvjAHdzrIBcVBCmLJoTqtIGmJtluZoyZOtziIdvvdCCrTdzxCNvwfxzknKlUaMcIvXugcFOStUbQ,en,2008-01-01,8,10,,8,event-HSghViBXbcmdHnxyzMfWbyjRDeuVnglXnqvwdBGJlBKgFOFBWJ,7,pjnnhqsvchptjayhcxmvtpeqjvhiacnopxnuhdgqxcssbmdgxk,,en,4,2008-01-01T00:00:00.123456Z,,,project-MgogfgDXGygMRbjvZsTCRydRSlkObzTNxourSfRlafQilCuYYK,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,1,Multilateral,9,9,lF,DQz,country-DjTjcfdLhjgCijUesXvSuLpTEBAhPQQJULtTnEPcxkzmwedcZq,society-name-YTuCiuVTBQuWKSlaYkqAfFvjcipGMFrmUlAcXaOxTvZNxvagEX,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,4,2008-01-01T00:00:00.123456Z,4,2008-01-01T00:00:00.123456Z,regional-project-ZPRRLqCONvcCscFgWCTmiDMJdwTVLRxPboQWedazsRNntXUanS,en,False,8,,,,8,FE,JMs,country-QGXznlhcyZgVnmWKVVtSRnLtxDdPOoKqnGbtanlvnFUyUuDzMW,society-name-YQpeNgabNdaratCyUKkgdxnPmBVxerAPbtXchtjqDZnhOVRYbE,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,8,public,Public\r -0,5310000,,,15,15,disaster-type-NbXGCGPGBvnGWvRMZcyEWnKAntRkSGSNGWEzbVuZOubQOtKiih,SDdqPJBWSWeIzRUCbAznldWezWkKRaEmZLLlXGNfRKIkFhJjASuXnXZoDfDVaIBtNqkzLskbnTSLIRQpfRXputROMSbhswXKNACbyMleNvICmaxqMHkroJGVXrQYpZdSjYSRVeDUIhAEGayOyPrQoRhvPHLWWdgyPqXLUQjPGfvamCXchEdMjAOtcCdnbGOIcHOeDkzjHkMAJlPXstHuWbQbDjHGQLvKlPPDOrfeAIaBLRhUMyhkZEzziaJcHibpNhDdOWZlAmRqrrnuZMyOPlPqvHRFaflaVVsZQQjtkQxnAMbLfjoDxpalJrKCzTdpNyPWCaiWspyuiWStcwwoSWBqGWfSICYxXrRbpzSrGIjhwTKCFpHxrTzAjmioBcyzZDMXNHAsLeixLtKFQliVdqlMHylkAKNiayAzeDKLAlmwyNLMQjLVMYUJpnuWJVEzJGDTFCNlxXBathpqHldHZqMpgumMHVmWMfjizabaestdPQSDzjNU,en,2008-01-01,10,13,,10,event-rvKabVYNQUKOkgCDKdxujJBBLnoYxfOQuVGIWbWUDVaXQumiRz,9,bvvhhkpylfapiiketipuwhpubckdshuizggthcsuditntdnzev,,en,5,2008-01-01T00:00:00.123456Z,,,project-VeYtVPQocsUKenthbnHZKFujOIEicLNIBPuQytkVYQSisavNTP,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,0,Bilateral,11,11,Kr,yWL,country-eoIJxdnslmAkQVicpmtDslqAnPgbtoQCTLAGVSRZQzYIbcJYPu,society-name-djZPfPQFCseDqmctnudjoIYYxdkkJNrBzvlCWvUWWkmmiHjNYo,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,5,2008-01-01T00:00:00.123456Z,5,2008-01-01T00:00:00.123456Z,regional-project-JNziKXIcPxzIiafEQxpOaCNAAgHBKvEjWWPUPXsatpYtFqhTku,en,False,10,,,,10,de,IyT,country-icnBcGNSWseeItONgoPvNNlIwwWWpxRKvjcxyecdAFKKaPbzKB,society-name-CEqcXSpEGrSRiTnQmKstLSxobazFDyWkvuankOwaeFnyuqizls,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,9,public,Public\r -0,6900000,,,18,18,disaster-type-chSIzoKMqwqgnUXJquoguynXdMpaXZEMzHQVvXNcPLBSQtxYLI,DiOrUcJVNMlSgDEOXmvPWfAzGeennNEmBCbESihEQoTsaTltiPkPkVrgSNHYUoZZdARplUpButagIgPYtsrksWJrjQQbkSrpZWxaSMtCAwSfhQVGBQevAraNZKsgtFwmNINTemDcutOitufRONdGlyeQXebPmuyuNrlVKLlcOlpEyTyBLQBMlXkKwooIyfKqfeOIYWmMRbNYoYYtirPOjsayBRlGVmrAmmZtRHIMopqnExgVHyBNqUcGBXZxZslspUJlyNiJvvbCrnvbKwkWJOHZNxMrEOapKBZMBsunuMgEzvcqDhZJHmacWLZLvriJGDnrsVUNPzQyHBBCLINLqDbASgDSPbBLdfqNCffbWnZHqYTCgvzEwABUuaPveIUGBbRgyFQsqKURlnsSnxNOBKHubruWbPvYAATKYoFvtciTVqlYJBeESILkvZChtcivdRpIuTFBVlWytGYeOAWWpHPsKpWVAJdQymuGwobUfbXfWjCJKyMv,en,2008-01-01,12,16,,12,event-NobyoWwFJPTbRoDJLXhQjgoQNUTCqpUzMKauvJuwFYxLKtSXbI,11,wrlkvaambkodstwjhmzibayeudyvadpocwrxccfzujcafoaqje,,en,6,2008-01-01T00:00:00.123456Z,,,project-fZNPnaWsPGxjTFDwHyWEdnyuAjdmVBnqtRsnOMqzGXMyVVTpog,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,2,Domestic,13,13,cA,FuD,country-IHPyPYWgGXiZbPFazyTWMchdDLioEXjLJjyJMoorTGQBQtMDcp,society-name-GNAHYUomvwSCaZFCpVgXkZQnguvvOcRXuCRcwiPfHENMRVoHrT,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,6,2008-01-01T00:00:00.123456Z,6,2008-01-01T00:00:00.123456Z,regional-project-ohCtrwDDBlRAiypzCIuScGNJMFFqYFXxNrRsPpsGTviLwmCVDY,en,False,12,,,,12,JM,aXr,country-uzgadFFFmPkeFwdoAfWKWQlcjSvNVLMUeLmHEmnDcmtUlZstrC,society-name-FBbCVIAiXoueaSEAueXWMeYEOcSJXwfESpQkILwfrwymqcMeJY,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,10,public,Public\r -0,3550000,,,21,21,disaster-type-YUWknVkbnByHBsiYCVEIyiBISQXvlEjHDVybUpjaGECJorCfVa,AlQIoorOOwWWOTxEpvBlmPiZCFPTXcdqvnvHwTLEndiXDoVOQikJwZCbtTkYqcWUjvvvsAHMUYSRoLYCDPcsggAEJIexYLAOYszPDoHzYvyMatrGQqVQBFVonlTlNeSksIMvwIDSCbaQBkpRNquLLRrkArcFAbOJMundfiTdopKGbShpUGFfWyjIopwBJNduJXecIRbhxnnDrZmuzDbiOPCFkGXDeuyxMBQNxDSLQswFvKvNKxxbvuPpSOyiKTOfChtGxseJoNwkSuiVQxjZdDQXHPGkXWezPugeNOTlftxFsTsujdZncYZQiEOyWNqDmbGUXJjtdmUxRplUfYkVssaVSlLmXBosPYYbKqflZTfJcxTQkwEKuLKdTbsEMqfiZPpjutAafJMfYhnZtVUoqZGTxEemnMXRNBSlDBIAflFpsihXhjbXkNfSTnGfocfsLtJckNHMdJIPHTeLyRAtZxkmhKgRKLcGjeQnmuzJUSngCjoWBOzF,en,2008-01-01,14,19,,14,event-TXbIodXzMCHWMLOKxgPqwsMJnADfqyEqKcByHGUACxeJvWFgfB,13,twbcwqmyxzntpwfgdopcnljbuciwhwbvwynpxeteeypbrmgyfs,,en,7,2008-01-01T00:00:00.123456Z,,,project-dtTSeEfaPnSJKfNhGYWEscubhpUnYkbWprZqLxBbFeqHEXzwdT,1,Emergency Operation,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,1,Multilateral,15,15,CU,BGt,country-zWWuCqOOryxSnlxRursehHgZXSIQWSvfnyCmGbRvjdnJPPIgSL,society-name-XgIXrFfqyQikbeqQHpmpurdghlCkInyamaGEXzsDEcUKaAQQEB,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,7,2008-01-01T00:00:00.123456Z,7,2008-01-01T00:00:00.123456Z,regional-project-bmQFPGUefPQVXduXSWCbmWKNyXndBzDbawMMrzMzzRMpTiXpnS,en,False,14,,,,14,UG,jpV,country-pEyDAJEsbqjbEADwftMCwmtfeuWEXnPXndNLdYcPTcKrVcYAxz,society-name-sUqvpHZvPQBxpvlmRiABcORQWacqDbKVfedVptLWQxAefMSWMG,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,11,public,Public\r -0,4040000,,,24,24,disaster-type-grNLQtclZmimwJxLowGdSnQVOvPkGHbvbZFucFTQGfLROCZnxq,YYsiwlrTSEFFEqsXrKyqYLpctBsZddBayKIGiytIBiVQDxZxZnFDLoYJwPsPZybLgihbqbDkxqZwUmMBcfWBdKNojOVqDbCKjzixQYgTEsmhRzXdnixdPoVRSXLtpROMGHqrjDJKwjRpBfYFLqKAUqvZtMSVwTNwDUGhlCUmUgFTsRUQZjCUgHoijRrbknMnzQiEygDArTbXQrcrUyvQxgfkJyoGfhbwaiTZiITMkcEXPsROvLwkYHTiCXAFEYrlnNnuSqnWoODmUYiTCHnMAXVLlfwhcaiyaFCWkeqmOOqSHyKQYyYvnFexwEphbwlaJKJmeJDobQZKxdENnoDCogiNEmrfVtHvdXkRSDQxMOSbHjAITbaMdEjlbJPOEfkWhHLWrwlpMPSuKAXcipneuZNXNHUDwhDxCYNbmkmaJHIdYBaMseDvakYUrhobdCGOIBFPwHSYFuvRIvaLvKWgtvcsNClpzANsRziClGBvgIhsXSictYoP,en,2008-01-01,16,22,,16,event-yHiZdtHhYScKpdwtHsTCnHwCWFMCnLZHVjrTvORupHgxfIkFjR,15,mwgibrilwggvlxxpdraxhyhqufvvlcpdghkbuunvtqvgdygrzv,,en,8,2008-01-01T00:00:00.123456Z,,,project-JrWQucRSqzjgFyqQmsMmKsgBYTWyCqcCJRJRSAKGVSxIuCrNeW,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,0,Bilateral,17,17,hY,sQv,country-dyLxeBuFRfkhhJBdPeIfhQUiQTPXoRNMomdluwLVGXFLUidBYj,society-name-MBJQSGSMgbLTyOgKWzJdswbwkfejWdnYBaHhzYrXgSJXaqqVYZ,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,8,2008-01-01T00:00:00.123456Z,8,2008-01-01T00:00:00.123456Z,regional-project-nDEdekrKnhBVrwRQMHjqpCIarCascEOLmyweZGCxzYLlBSLiWd,en,False,16,,,,16,IS,jRx,country-RuHaYbLFerPdJAmplntnbZWzvIXFssSISHJmNPkpDvMUaKFljH,society-name-JvVrwuhnNXhKAYbntHkXWpBFIJnJTFmzKOmjpIbcqSpAqCxHtA,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,12,public,Public\r -0,3440000,,,27,27,disaster-type-jYVfDhWksXoxyBGQZpYVdnjwWmyKxTjxuICUVyFnuUaEJWfVdQ,FlHSoPMtZDyrUAVRelRyfqNSOYMnQzQpgXKzlCvzStqoLWcLueOMvzznbdPzmyjThYdwReyqdCGDVZTPdtGgfnVPxWWmSUEVOQOpMAxkEOkWZMuLVIzCDESdvxtHLLTXcEflSLMyMWMgusTJlEadQiKpnXSgnizGKmEqAbkepBWIIsexFEfSiVMeHrlSOPxeULwYAWfEBQxvJMkjoSxxiSIuJFQbBmaYQjXjJXTlMoZpwjICHNFgxUmwZMPAtFkAHQtVFrArRxucDRjHpgWahJwURdHIdIEuzVtwWbVRvIhPauHagaJPJRAFMFZqqFBfLnCIZXUJBymyYOsyWvpootCCrVKAomEKjjYSBkGhNewalnFsnJOFpsudukhMsauOaqEiWAbNEPKBkMerwLFCpAybKIWVuLhMJfCWtFUoyBxnNCPHHwHCZtGVMRRwPxChphZONIqqqYUMyeBpKulvEqEEErpCOkfjoGrGDCxyeYNfJWKHEvxF,en,2008-01-01,18,25,,18,event-mjTqVviSCSvACgLOvdZYUpdxzGDJdDYeiSXzvjsNsYIMeGwkZU,17,mgpggkateuhrldcfarkfpzufawcawigkitzwygkpuqrtkqbikt,,en,9,2008-01-01T00:00:00.123456Z,,,project-LQIoiUlMcOXbduLauswVhCoyuJxscuUKeKortlsAiQVEgimNop,1,Emergency Operation,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,0,Bilateral,19,19,Dd,Qzr,country-MCpUiJlKbhSJpiaxgfWkemqbBmyIbeNMcxbltczueeREOTrEZe,society-name-IwZCKBGJzmOQfkYYqdCVQMbtOtIRfpIQHhKdhgWrvSAFYSzDCA,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,9,2008-01-01T00:00:00.123456Z,9,2008-01-01T00:00:00.123456Z,regional-project-GlUThMzaHFJFWOuOEGPJjXSYEmDBpdLEDoLPGUpByAbKFQKFGZ,en,False,18,,,,18,cS,nbm,country-EnvXFhjxyElejpabJXvDQGKwYLhxojTtlvXyybaLIYUavFZInA,society-name-repOzvPmiLGuBUIrNRMCUZCbVFZcBcbFrygrYppCcdYrULfUQF,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,13,public,Public\r -0,8280000,,,30,30,disaster-type-TYqlhJhJWceZHVErDkMfTSoghkywNSCtyandiRngieFHhCYWbt,lTpiFuHIJffIuNZkbAnbqhywiDkzfJKgaKwogcbeDMQlWueozOkjmIPbenQCclbKPJfMtaeWryNyfTpzcDFjFkcOVsxdSTKJaBVnSRwopnxbhzTlAiuectKryhFpcxQeZUvgnoQibLzCmdLYjsaEtfOmvKORAAvppKdoYyoQHxErmoMgLuGbSabYJtgzjRyFxcfTtBHpPhrzxaYboKqXOxxGTRUTsyVsPkdgGgWPMbinkagywgMHJMazVbMhFXwcDvhVLkyDEOwZbrzgzPkQjROGOsmUMRBwBIVOJWOFYkajaqJFfboyYRvosFyWsfqsYjUTVEhRLCsvnesxLxwaJddjONbBULwtEmuBqiZCSiLqnAOfcYNbKHkqudPHhqTBQtCcjmAaCshFdYBaklxkvumQQfmqVfCAllIbKwteFxrRcgypCNcwXJrJkJhCmNnnWNVzNOgbWWIkZLBPQwBgiZdYysyrUAEyqDJwykvdJqwdVRePtpYK,en,2008-01-01,20,28,,20,event-aaAenHyvrSLBzdkPufrpvIUcrEfeJTbYctvdfuVpeThKuNOAdj,19,ezmxmzsrywffmbaduqgvyjuewarkltzqwdylqqvsgawhxuwfvq,,en,10,2008-01-01T00:00:00.123456Z,,,project-LKjwDaLLkGBhajHwOvWgqpHRjuRvjaplRUIWAvKhIWhKYHcXwl,0,Programme,1,sect-uVAlmiYIxHGrkqEZsVvZhDejWoRURzZJxfYzaqIhDxRVRqLyOx,2,Domestic,21,21,Hu,NzJ,country-uOrOsFtFpprSoxPPMEpBWMEcgQBGXxjxpeQZSEZudqaYKnEbfV,society-name-KSCrPbVNwkKbuUYQwcMwEKjGeHrCUjyzGdznVMMOlseBOgfMwr,"CefuMjeirN, QWBUdsMtwg","1, 2","False, True","False, True","district-hQbiawYYpLublqdiVAHhVeECXxGLgCGoNcUYQHtDPbdEzBRgFT, district-gYShPPXJUnBCoAvDzAUguBuQqxjREefffBgVVxZiJdLJJvQhAw",0,0,0,0,10,2008-01-01T00:00:00.123456Z,10,2008-01-01T00:00:00.123456Z,regional-project-oJHsbgVBOEDYzLjSSeLPhVbvaFgLDcMwFsWtwTrbBLhtpGDZBE,en,False,20,,,,20,DC,unL,country-dRPsrxQcCTiMzkNUXVbRfbCNoTlSjzwjCHkwsypbvNtQfVwBFh,society-name-JXUYCkrZOuJfTLYJDQcGQGtaFvTuWmSJZaxmVzvNOEjBHnNxcX,"1, 2","sect-tag-RoEbNJuNoPeODStPAhicctFhgpIiyDxQVSIALVUjAPgFNArcSx, sect-tag-CCpxgRxIPwdzrmhDfQnPOMbdYvpiYKneWJnLnovXjYMarjiIqZ",2008-01-01,1,Ongoing,0,0,0,0,en,False,14,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,1,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,2,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,3,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,4,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,5,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,6,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,7,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,8,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,9,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r +0,100000,,,1,1,disaster-type-1,disaster-type-1-summary,en,2008-01-01,2,1,,2,event-1,1,lklfnynrpfljodoqdqqazdsrikecwltobsqdtmyegpykwksssb,,en,10,2008-01-01T00:00:00.123456Z,,,project-1,1,Emergency Operation,1,sector-1,0,Bilateral,1,1,Oh,bVr,country-1,society-name-1,,,,,,0,0,0,0,1,2008-01-01T00:00:00.123456Z,1,2008-01-01T00:00:00.123456Z,regional-project-1,en,False,1,,,,1,Oh,bVr,country-1,society-name-1,"1, 2","sector-tag-1, sector-tag-2",2008-01-01,1,Ongoing,0,0,0,0,en,False,5,public,Public\r """ snapshots["TestProjectAPI::test_project_delete 1"] = b"" diff --git a/deployments/tests.py b/deployments/tests.py index 68358da75..f064e5afc 100644 --- a/deployments/tests.py +++ b/deployments/tests.py @@ -4,7 +4,9 @@ import api.models as models from api.factories import country, district +from api.factories.disaster_type import DisasterTypeFactory from api.factories.event import EventFactory +from api.factories.region import RegionFactory from deployments.factories.emergency_project import ( EmergencyProjectActivityActionFactory, EmergencyProjectActivityFactory, @@ -16,11 +18,15 @@ SectorFactory, SectorTagFactory, ) +from deployments.factories.regional_project import RegionalProjectFactory from deployments.factories.user import UserFactory from deployments.models import ( EmergencyProject, EmergencyProjectActivity, + OperationTypes, + ProgrammeTypes, Project, + Statuses, VisibilityCharChoices, ) from main.test_case import APITestCase, SnapshotTestCase @@ -188,18 +194,43 @@ def test_personnel_csv_api(self): self.assertMatchSnapshot(resp.content.decode("utf-8")) def test_project_csv_api(self): - _country = country.CountryFactory() - sct = SectorFactory() - sct_1 = SectorTagFactory() - sct_2 = SectorTagFactory() - district1 = district.DistrictFactory(country=_country) - district2 = district.DistrictFactory(country=_country) + _user = UserFactory(username="jo") + region = RegionFactory(name=models.RegionName.AMERICAS) + _country = country.CountryFactory( + name="country-1", + record_type=models.CountryType.COUNTRY, + society_name="society-name-1", + region=region, + ) + sct = SectorFactory(title="sector-1") + sct_1 = SectorTagFactory(title="sector-tag-1") + sct_2 = SectorTagFactory(title="sector-tag-2") + dtype = DisasterTypeFactory( + name="disaster-type-1", + summary="disaster-type-1-summary", + ) + regional_project = RegionalProjectFactory(name="regional-project-1") + event = EventFactory( + countries=[_country.id], + dtype=dtype, + name="event-1", + ) ProjectFactory.create_batch( 10, - project_districts=[district1, district2], + name="project-1", primary_sector=sct, secondary_sectors=[sct_1, sct_2], + budget_amount=100000, + event=event, + regional_project=regional_project, + dtype=dtype, visibility=VisibilityCharChoices.PUBLIC, + project_country=_country, + reporting_ns=_country, + status=Statuses.COMPLETED, + user=_user, + programme_type=ProgrammeTypes.BILATERAL, + operation_type=OperationTypes.EMERGENCY_OPERATION, ) url = "/api/v2/project/?format=csv"