From a03f9078e59e045cd4ee1b7a5fba8f078369253e Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Wed, 20 Dec 2023 16:52:00 +0530 Subject: [PATCH] test_stripe: Add migrate customer from server to realms E2E test. --- ...realms_and_upgrade--Customer.create.1.json | Bin 0 -> 795 bytes ...realms_and_upgrade--Customer.modify.1.json | Bin 0 -> 820 bytes ...alms_and_upgrade--Customer.retrieve.1.json | Bin 0 -> 1916 bytes ...alms_and_upgrade--Customer.retrieve.2.json | Bin 0 -> 1916 bytes ...alms_and_upgrade--Customer.retrieve.3.json | Bin 0 -> 1916 bytes ...alms_and_upgrade--Customer.retrieve.4.json | Bin 0 -> 1916 bytes ...alms_and_upgrade--Customer.retrieve.5.json | Bin 0 -> 1918 bytes ...r_to_realms_and_upgrade--Event.list.1.json | Bin 0 -> 1695 bytes ...r_to_realms_and_upgrade--Event.list.2.json | Bin 0 -> 15849 bytes ...r_to_realms_and_upgrade--Event.list.3.json | Bin 0 -> 37397 bytes ...r_to_realms_and_upgrade--Event.list.4.json | Bin 0 -> 19962 bytes ...r_to_realms_and_upgrade--Event.list.5.json | Bin 0 -> 81 bytes ..._realms_and_upgrade--Invoice.create.1.json | Bin 0 -> 7140 bytes ...d_upgrade--Invoice.finalize_invoice.1.json | Bin 0 -> 7475 bytes ...to_realms_and_upgrade--Invoice.list.1.json | Bin 0 -> 83 bytes ...lms_and_upgrade--InvoiceItem.create.1.json | Bin 0 -> 1121 bytes ...lms_and_upgrade--InvoiceItem.create.2.json | Bin 0 -> 1094 bytes ...lms_and_upgrade--InvoiceItem.create.3.json | Bin 0 -> 1120 bytes ...s_and_upgrade--PaymentIntent.create.1.json | Bin 0 -> 6097 bytes ...lms_and_upgrade--SetupIntent.create.1.json | Bin 0 -> 930 bytes ...ealms_and_upgrade--SetupIntent.list.1.json | Bin 0 -> 1116 bytes ...s_and_upgrade--SetupIntent.retrieve.1.json | Bin 0 -> 930 bytes ...nd_upgrade--checkout.Session.create.1.json | Bin 0 -> 2379 bytes ..._and_upgrade--checkout.Session.list.1.json | Bin 0 -> 2769 bytes corporate/tests/test_stripe.py | 106 ++++++++++++++++++ corporate/views/billing_page.py | 2 +- zilencer/views.py | 4 +- 27 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.create.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.modify.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.2.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.3.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.4.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.5.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.2.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.3.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.4.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.5.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.create.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.finalize_invoice.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.list.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.2.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.3.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--PaymentIntent.create.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.create.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.list.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.retrieve.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--checkout.Session.create.1.json create mode 100644 corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--checkout.Session.list.1.json diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.create.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.create.1.json new file mode 100644 index 0000000000000000000000000000000000000000..2d5be59dcd330724d9f026de72e541ff52008bf5 GIT binary patch literal 795 zcmaKqNpBl542AFh6~>(Fz#GuGrxZvI1-bw|rYHnPdXrJAWva!n6Xd^#(s;ZyK<75( z<0JV|FO%uCA*BLhY(7n0Hs(VKJ&++M!J&EmmjRTZ_bWjotQ)eIFn zN}sFE(HxevDfJy$gLE_4NN`OlNA?L z-ys9HsmL6~QG-;uzXh!@e(q(s)qRW1n^imo_VeP`k1yZ9-JP##&H9ivTPry-=dqDp zt}In=(*a|Y=5OY>Cx%3k1f$igk*LHeUP=v&9PBi$%rwT<78g#l`r>AF3G4GK@b+PS zAHH_ed3$>e#SS$$)<*O+XV{NobOnK)<}+Jh4fDv!Q^BI-7PS@mrZ049EC`73;@MMC zL`L^knzc6MYrLaA7C6jN3^fU!imV?5KW;Rw+z?lt4j{UN=!Yi*ok6HM)5jA;bWF4Sq5&mZDq~<#Z_( z%N{yN*QPLiaHxeg2LAc-+oyLQKm58l$2R9XtzA1Ufj1sX zy&=nFb*K&yqqZx;@d+_R6ft0QH7_+7HHH^e9Y&4V*4Q$yAy$s6$gVU3Z4i(ZR}iuG zA!>>|jI6WI33VJ#f@Jiugoi(>!W=Niyd6~81ARzQ98)wdL}9peiuU6#KUBs}kzk;R z&or6*v2GUop3I86a~l~qm9w3A7ov~Fr0`?N2sAHjn&nytk*2pxDl3rp`yitE4o03p z;K}A#OP$%M^M4!5wd|Fw5qMX9>wV>zdKd}2`aZ4{HVvof~Pa*rN_%SoGmjV#09x7ibXMY zv=ASiKLYO>H&@&m8sK%00+qtjd`6<1p&!)Jr2!HPjgr=+Hyk4vD-XaG4}e4iybWSS ziS`a6v`yoDX0GU4I2!0t803WgRDB}C=_vK3Hu8l74dq|-k?bOV3XD@@aE{=anpa2}RKg*9@0Mua zxNS39V`eX=i`U|Gy2N#!s)d3xd3shXU`Dr<%Q~PBW?>V#-Z6IodRWqXlTL~asPz*h zyx5p-vY^{UZk!Yb2#)KUqzaX8ntV(hek_U&hYi$CYS$8XC0ly1xWo|m=$|(F`Q#7Y C;t9b3 literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.2.json new file mode 100644 index 0000000000000000000000000000000000000000..6c4cbb014069e2dce8d047638a6ed50e01ee1bb5 GIT binary patch literal 1916 zcmaJ?+invv5Pk1gM1CeH*#^<@1X3%61e9APL{(X?J)3pwwYRo6O{n_s%-GpWLSWx^ z?sI15_~~RaVL~YnA+R?S+ZywNM7P2SD*;8b^e;V#2nzq_v+m1^)_bsWJ9bu3iq=Ff z|Dy}8^(lUzQi0L-p#>W;Rw+z?lt4j{UN=!Yi*ok6HM)5jA;bWF4Sq5&mZDq~<#Z_( z%N{yN*QPLiaHxeg2LAc-+oyLQKm58l$2R9XtzA1Ufj1sX zy&=nFb*K&yqqZx;@d+_R6ft0QH7_+7HHH^e9Y&4V*4Q$yAy$s6$gVU3Z4i(ZR}iuG zA!>>|jI6WI33VJ#f@Jiugoi(>!W=Niyd6~81ARzQ98)wdL}9peiuU6#KUBs}kzk;R z&or6*v2GUop3I86a~l~qm9w3A7ov~Fr0`?N2sAHjn&nytk*2pxDl3rp`yitE4o03p z;K}A#OP$%M^M4!5wd|Fw5qMX9>wV>zdKd}2`aZ4{HVvof~Pa*rN_%SoGmjV#09x7ibXMY zv=ASiKLYO>H&@&m8sK%00+qtjd`6<1p&!)Jr2!HPjgr=+Hyk4vD-XaG4}e4iybWSS ziS`a6v`yoDX0GU4I2!0t803WgRDB}C=_vK3Hu8l74dq|-k?bOV3XD@@aE{=anpa2}RKg*9@0Mua zxNS39V`eX=i`U|Gy2N#!s)d3xd3shXU`Dr<%Q~PBW?>V#-Z6IodRWqXlTL~asPz*h zyx5p-vY^{UZk!Yb2#)KUqzaX8ntV(hek_U&hYi$CYS$8XC0ly1xWo|m=$|(F`Q#7Y C;t9b3 literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.3.json new file mode 100644 index 0000000000000000000000000000000000000000..6c4cbb014069e2dce8d047638a6ed50e01ee1bb5 GIT binary patch literal 1916 zcmaJ?+invv5Pk1gM1CeH*#^<@1X3%61e9APL{(X?J)3pwwYRo6O{n_s%-GpWLSWx^ z?sI15_~~RaVL~YnA+R?S+ZywNM7P2SD*;8b^e;V#2nzq_v+m1^)_bsWJ9bu3iq=Ff z|Dy}8^(lUzQi0L-p#>W;Rw+z?lt4j{UN=!Yi*ok6HM)5jA;bWF4Sq5&mZDq~<#Z_( z%N{yN*QPLiaHxeg2LAc-+oyLQKm58l$2R9XtzA1Ufj1sX zy&=nFb*K&yqqZx;@d+_R6ft0QH7_+7HHH^e9Y&4V*4Q$yAy$s6$gVU3Z4i(ZR}iuG zA!>>|jI6WI33VJ#f@Jiugoi(>!W=Niyd6~81ARzQ98)wdL}9peiuU6#KUBs}kzk;R z&or6*v2GUop3I86a~l~qm9w3A7ov~Fr0`?N2sAHjn&nytk*2pxDl3rp`yitE4o03p z;K}A#OP$%M^M4!5wd|Fw5qMX9>wV>zdKd}2`aZ4{HVvof~Pa*rN_%SoGmjV#09x7ibXMY zv=ASiKLYO>H&@&m8sK%00+qtjd`6<1p&!)Jr2!HPjgr=+Hyk4vD-XaG4}e4iybWSS ziS`a6v`yoDX0GU4I2!0t803WgRDB}C=_vK3Hu8l74dq|-k?bOV3XD@@aE{=anpa2}RKg*9@0Mua zxNS39V`eX=i`U|Gy2N#!s)d3xd3shXU`Dr<%Q~PBW?>V#-Z6IodRWqXlTL~asPz*h zyx5p-vY^{UZk!Yb2#)KUqzaX8ntV(hek_U&hYi$CYS$8XC0ly1xWo|m=$|(F`Q#7Y C;t9b3 literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.4.json new file mode 100644 index 0000000000000000000000000000000000000000..6c4cbb014069e2dce8d047638a6ed50e01ee1bb5 GIT binary patch literal 1916 zcmaJ?+invv5Pk1gM1CeH*#^<@1X3%61e9APL{(X?J)3pwwYRo6O{n_s%-GpWLSWx^ z?sI15_~~RaVL~YnA+R?S+ZywNM7P2SD*;8b^e;V#2nzq_v+m1^)_bsWJ9bu3iq=Ff z|Dy}8^(lUzQi0L-p#>W;Rw+z?lt4j{UN=!Yi*ok6HM)5jA;bWF4Sq5&mZDq~<#Z_( z%N{yN*QPLiaHxeg2LAc-+oyLQKm58l$2R9XtzA1Ufj1sX zy&=nFb*K&yqqZx;@d+_R6ft0QH7_+7HHH^e9Y&4V*4Q$yAy$s6$gVU3Z4i(ZR}iuG zA!>>|jI6WI33VJ#f@Jiugoi(>!W=Niyd6~81ARzQ98)wdL}9peiuU6#KUBs}kzk;R z&or6*v2GUop3I86a~l~qm9w3A7ov~Fr0`?N2sAHjn&nytk*2pxDl3rp`yitE4o03p z;K}A#OP$%M^M4!5wd|Fw5qMX9>wV>zdKd}2`aZ4{HVvof~Pa*rN_%SoGmjV#09x7ibXMY zv=ASiKLYO>H&@&m8sK%00+qtjd`6<1p&!)Jr2!HPjgr=+Hyk4vD-XaG4}e4iybWSS ziS`a6v`yoDX0GU4I2!0t803WgRDB}C=_vK3Hu8l74dq|-k?bOV3XD@@aE{=anpa2}RKg*9@0Mua zxNS39V`eX=i`U|Gy2N#!s)d3xd3shXU`Dr<%Q~PBW?>V#-Z6IodRWqXlTL~asPz*h zyx5p-vY^{UZk!Yb2#)KUqzaX8ntV(hek_U&hYi$CYS$8XC0ly1xWo|m=$|(F`Q#7Y C;t9b3 literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Customer.retrieve.5.json new file mode 100644 index 0000000000000000000000000000000000000000..920ef4f3eb7e4f7f44ffadac6ee42ad570b8faf2 GIT binary patch literal 1918 zcmaJ?ZEw>s5dOYjQTa1PZC1p}Cy+KFBw)NvLQIq8IhV$pV|%vKwM_f(+}TN*mO{Se z-tW1)$4@7d2@_@MAq4hjVp^?Vkmy!uVI-hvmj0y&5uwEY`KDM(3T@tgVv3 zorg+o$TC?SssqHR%!-hFLKG243>a<0D+Rh71B|L3Bqz2Fw#*xdwWTVuD-A(u1Z2fa zh*0 za81BFuhP!v8AV+@8zU8*?FyaEHB4xLvXFXM2wOp6c~Vv3QO}DiEeiNpq4HTkXmSzv?hb$7{OS30ABI{$TYy)AXb!U z?;t|!ob{QzqHp17phuyR6ZTULi3q2o%LL;ZKEJ$Lei7#vUxl|1 z=Xc@#W_DWt{IT0rrqvpnd|LwxrWi;Oq7+e3kGt~h?Hx!e9(QezN_s$9+&aP~UrPd@ z^JbN`G1b01MTUG{0zkwswQ?>WQ;#2uV#8qrjZ5ts;;v*%4;Ggg;vW6eMn9kY0j>`T AYybcN literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.1.json new file mode 100644 index 0000000000000000000000000000000000000000..878dd4cf6f29fc3ceb9af0468c75bc3ebc20b893 GIT binary patch literal 1695 zcma)7U2oGc6n)>XsQgT}ByCyC6G)v95@UcsLQKeV>>J|Ei8I>?-KPC_uH7VU`hnQP z6xsLV+;fg^pU)-}BA8?3&EyupCzI#!A5U2=X$!_mUEw83<1~)qMU-BWSA7UKz#Is? zPU8M=xa_L-^{}GO?tnXt-k$kBLKv_XkE=$hKHWnh8B?s{fLHP8{9k=TB5#a=ia#DJ zDj;W#a`b;(82J?AxhERix=f-7`DS(h}q z`M&(jR##t`(GROT`+glyiyzz+(dXJ-Xs%Q3PB#@FV zlv;Ri9jb@$*nxe6ItG&*Q1rbjX`!uGpX{r<4}6r=G#hz#9gs$|OE!&`s8J+l0v3F_ zNM{g}lkh86dg%L1kP6n0%1&7e-k`z1$!PfDA$Hm!tE2n6(AClM-YbAlOHidbQ{ZX7 z{WZ$9g{*57;ut!|))dxI)`7OlHyP#n2SPcPzVEV!`FF%42%?o5-OZdcGHWmk!*@+d zwhWvy?MX*^N{6=Sn&G?u8laGkkkGn~h56RP5Bj=H7OTZD9y#T=?NTJr`fbt^LTa?M zH}oIK3a#(`jKda0zoWFlecQP^Ja~2b-D3>Wj~2$|NbkWfNCKDhB+c@9B;xpWG)ve# z%3_{Hc`}{PXVW-M^F{B(?eOlg_7)i&bl%kXWbnrz5a!7WzQ9#wX{n8mb*2eha%W~G WaR@&$X-wE`7j1G8h_K}Bk*F%N`C772LJB${*b@nQ=0hBg7MUkBN!y3 z!D!GQ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}jjqHuHvqv4WOi5JQj z)T-z})NmEl)|B-^`Kq^iif@_O-#0UY^G=j6@}WL_yHLNQQ}}Y_9_W|IEbp5AnFR1@ z^xQ8r4hn*f&7{LmvviWSGC|kC#MZEMrkxI=U`J%O$4N2fS$c^}Bxo>7}mY literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.3.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.3.json new file mode 100644 index 0000000000000000000000000000000000000000..49f2408e18cbae47648fc6daf942851a2db68672 GIT binary patch literal 37397 zcmeHQS##Vr5`NFGm}2e2ZdFF&T$-6wZEX%YsU(gS+wnR_xmXwyHBNKDK^KqP#7zhdTNmXb>do-37ftW3q`@(XChEXk=~L1j%2T~jx9y`Nfd!Cff~I%Ep`cZmBYn70_|hfCsFji zQDBF`GQ050ETgf{tgy_3#@l5MC41YDMrNz>nE=gLWy;)pa`EhkFCKsU>!WiR9TQVw zG=rW9GMY<`XhHI6;k7eMPP^YcW z<$e~Xw(%E)IdensV!L$l%v5SgJ#cqMh0^U74fP5JGb*X=D4E^SIKbhsA(0rBy5HF* zNx{sjRjX|V78%A@Nodx|F3G_|O9`*cxEU2intyhBDqcLv3s4G0gE|dQ!66sA>4Nc| zf;zR|PRJ~H^z6T1@BIDx`q?+>&Ev1vPoKXmrazqrzmjP&z4-ZA`s6&i+Dx7-p1*lk zkn`Pl{_N`)&mZ|WkIygNCpS;$KfLh~SKOyBvTuHxZNK&xX`Om zfOK0VjM*q?cyJBy(f;@!T?&8aC;%Ey=b-WW(BOg^01=FfYt}8 z^A9i(_jI4c#cmYScO&T)M{2YhswJNZ2yG8q`7JT35z;`(21G+aM;2!-N0@2U&rHR~ zrLl&9<#@(K=T7d#6Ippp`~6KhlS>Z zWJ8>;39l5wf1Sft&V<-}0zYS;>B(XpZegs&x3LoV&S5)2p(MF1Q}2@E+^6YCR3#4B z6OOeOQ zn@b#O5EhJ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VCF9|Yf1aC~i%Y}d}u!ozm zKIg^y$zCsl@4ABkrtaJIFr7L&rM5^KV&9yt*{rnTr8U=+|H!H$3TUOPI@Lh{VEx=kUfqiEWw+O-AH6+@5crpXF zq1n65io;De)k|f`yQgje)A4*sX5%&NQW^*IfUf-6YC5NC9OIH-jb*m}kICM6aT`15 zL2jeW@wOyBf^`2~Q7GhgTdm4Yx`PNRw5(!RTPD-yB8GW6rK)b(nn*AMOK zZN)T|@@uV!DD}ZJJ8FZw)dp#c4Vmgw;wSaVX2`RK9M9j;i*oZ~qtti2$RRD|L_gU9 fl=TXouaUo0TbM?nxL(t#U7N{Pt8gXeAD{dWg{ki6 literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.4.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.4.json new file mode 100644 index 0000000000000000000000000000000000000000..514704e645721ef2abda31ec8a119c184d226ac0 GIT binary patch literal 19962 zcmeHP>u=jO5dXfv!Vvah1LnrBG)aMBucX7)E?ts#8#)vOEzva_y(&>&lcN9o?)Z>J ziL{+zk2+I6q>gnwlE=II9q&$k|H)twL{!k=(cpLZJQ%!}zu{Y&bFyMZ$+Hw529wcb zG#nidCr7~-h9oQ)6)b|sF6NXup3L<|OH#paet9lMx zQcaT5gyHiiG>r;6cuMEx7lR+t@PV6L(07DKC5%X`I5rDY91}TbR3X2S>rqZQZp`_t zUmnd4G6)KTuZIH4E0nVjVLN+Z?F;> zq0x$_A?|)bmV%1P$XqK5iu{AMhB=R8kPiU` zDwTdEG_7cCA7r?s#cNz+M^IrF$Dm6fMv^eG%#!@GgiP!Lh5c;M!q_`hL|j~oJlz{u zo8s@UEQ*LNXcY^R)0>2W7pPCOGpV60v#OAa>!rZS3UEv))6R5dSn%9ue-SUG8-jsd z?)sUFYsCn-JEuU|Vu6af0%JxYbseSDJC;Uh4s#l7tF-;jBFltStInzx1!yEsR~dK9 zWSN!Vp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qem=zIV0$)C;8C|3Xg literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.5.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Event.list.5.json new file mode 100644 index 0000000000000000000000000000000000000000..6d922067afeefefcba3c644d2dd8510c1d8984a9 GIT binary patch literal 81 zcmb>CQczGzNi0cJvQmhS)dBG`5{u(=^NUh}B58>^#i?My{G_bZ Xv?vE8pkHRFpIVlhS5mCRRm%kck@XgY literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.create.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.create.1.json new file mode 100644 index 0000000000000000000000000000000000000000..b8669a5c16c000e1397b1c7047420ff9e778561c GIT binary patch literal 7140 zcmeHMOK;pZ5WeSE2t*Gpki_^4~kdmq^7{``a7FGY&=9LIlRs?)4_%68^{ z^F*}|YcP|+FCR8GoZq4%~shx5BDf7!$8rJfDjJutd38Nf6+B0c*@YLCXvhIed7TvenP2)YR-BQ>w2;M=gAdpq-V-883NiKn0|>%<~X*4l)T05(w^JHfR2)& zMj5#2-C;My62$a{s2ZV%E??qpgPS>+G$)34TB8xD$&Y;^^)6f-a0A9hwaeMY{WvFwjCXy<6%&B zK$4^=jpa0~Nd5*Bj*Ba_Q9Cx3?DH31((yfW($bOL_8ht*M>`u&8fI|X*Tq7DMm5AA zW0B38R*P|7ubnWy?Lcv|635Efj?)edmTG*z$AY+lBFD|;>0EVKSUVExLfs6a-pFAvP(4XPoyOedS-x+HP<1(^GRuV#?b5N^m$M}^7D`PqDc<`2rCjR) zODr!SF?JSu<3^ZSgG1B!u*Q~ypfH&E+&5qo8__po?)(RvEx3lc4L=ejP!_FpK2)KJ z7kX>05>0fx%qID411p^MgR+N4@z+ginr*AuK|KIBA-Ma_fg~%`fN^7PIlrLtI>G*!=}%ifdr%s9&&%#>lns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ripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.finalize_invoice.1.json new file mode 100644 index 0000000000000000000000000000000000000000..735ac024ff9930c1bf5c14fbdc457fc6c2844562 GIT binary patch literal 7475 zcmeHMTaVN>6n^JdjG{iYQekFiX3IsYTG|CfyDViF+6sg$PvT+BCQh)OVRsS#z32EA zJCmTP)XSoF9?)VRAD`=I`^$$LlSxMNyl#ai=3jZ4-J4`D&a$uLDM2fS<3CeTNIE&D zEA{o{vB+({hY-9!a@=L9^4nGX;v z2qY79RT>pR6h@V%y7e&u!H-7wikBt$LnNchxR6y;w6wGV%{NrO!97D9^SUfqj_#6* z=}nD>W>$<)u+x}B%kt7G0KM9naxn8hvv1x?$wY3l+^WJ!w+b|nHD_g-z1&PNX*O#W zIeB{em9CMu2HWmu8y0uzp#3)GPs)|Kq5*Jh?*Yuc8YH1x7!&=n!tLAjSubt_F_ z?98B23Gv5R1hp!cyy@3#!Ifz{5bU(Lv3PaMNC66CF}7Y~L2RMO(YaopnJBQlR2kXG9CY2B!M)2Ul0HmB{(jn=9F^PE!O7v-+fz-C zHb3QyhcC_^=d+WmXUivV^Z9H(n>~9WA3a~J?|-MhrHxIkL6wY)z9qg5T-iDg zNK>pKdfCP~25C>6vVr+GU7Lc1k$WYDaIU$aCBHK8N0^i~c4$axiKV9jTDDyE@DVV_ zRHZ{Ks3{67Um5(GI2n(M(p=*tG{J%gi{Xbv@y_>`usk0Ic6BtQxpaODCV z`io(&A~A+`4wPxQk{}EuwG4$=K$F422d#~>==R_?k<$mAPnl|0F}S5s%P{m7Kz9IW z_tIeVkogEY(CI@!9HBla_u>@#yK~vWIXH?SybsXt$n6jGFY(ql`Jq*K3aO|P0xXXO z$HVqtjq3B*i2YGLSvHOmVUR=Y8OL;#yDo@6kGkucL3$jfPXhYQgWKOEp&z}v z?+ES>>A%=#^5n}OsVpY;)j8o}vYapHU&Y|+5&WM<_(g2Q{s^Be8%K=41>qrS_BV|1 zes=ah!uwFf+4{T?zGwO8iSRo}GY;}j^t#~uHNLr9Q1*fPXqx@CMFe0`@mVH&L_%_{ zRQ`pX=~~m$vioq&UpN(x(3@@#JejB9kMvRL+Y4zt%N&6f=FAzqMD2oMCfG$srBX|> zyGIq;k%_iiS$f$~%Qs<9d+Uk3ajL#k7X^bN4{ZJnsuceUFO;N4!Ey7n9mBz5e~^Lf(_Xcb%6A zakYdF8DelUHy5t@Aw4FP4G^}0wYJY#B7p5x9VKEp;6}2&tfC=h{_{PT@e*n%nAZP#p literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.list.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--Invoice.list.1.json new file mode 100644 index 0000000000000000000000000000000000000000..e39960ab7254f5b071e40ef45d6574c984929f3a GIT binary patch literal 83 zcmb>CQczGzNi0cJvQmhS)dBG`5{u(=^NUh}B58>^#i?My{G_bZ Zv?vE8pkHRFpP5&dpP8Imti)Bz1pvYK7f%2H literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.1.json new file mode 100644 index 0000000000000000000000000000000000000000..c351f1fdd5acdaf9cae7a1b1411840fa231375f5 GIT binary patch literal 1121 zcmaJ=%dQhK4Bg+a7|jYKkfxU_kk}z$fy7HJK`6>3F4r`VA&-ixy8n)yq-_Q&W;L;o zPmYhB-a_D@%29m$^yR~=_wT;G zeM4oNiqSFw8gIKL&Ke-R<4&c1J`|Xr ze}ZC*#>RmOY$aVFpy&IKWE&Yr&Cp@pK80hFfe9`Nf>-jzNH*oHX$e(iBa|wUNCKQK zAi5ciAx$ z_q)7^9q?Xt)c-h6SchuoWNEHLUM5j(;_(o830~(qA^u(KtK%nB0B)UpTi>4KZ!yEY z+@mk6on2f&;TFlh#-9*E6m3&FIVngNw?0_$D@&I!{nc1HEM+?0fk;TrG(Mix#pLec zk;*P7H0iL?@PHd=yzEWzLADol-i@)-u_?P7^W49^llYOlrh4e!5gn3H#;aXtP_Ku= Moz^~cRq4acAH1kNE&u=k literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--InvoiceItem.create.2.json new file mode 100644 index 0000000000000000000000000000000000000000..f6b553cfa627a7ebec263720368b23d8111994b3 GIT binary patch literal 1094 zcmaJ=%WfMn47}$n44r%MYmv0K7RjMNA3%>O3PG!-8`fG$)x&6DO{~`o)JF(L#)^5Tj-tsy9rqQzk;`Iauh3>|>1FIpxenwD$JnF+pJUaPy-aV;5vWF*i zKv!-#+vq{#4#~d8pAbTn?NVlPQcyPTTo~o=tZc&c&tU1%cIA;AHO4~ZiPMQQ5UF_VvyI0LKE{&(!8)21+@r^bGM zd46^-cU{+O7qX}Rb@$@_)o!*fb za@oFOMoqx^JxA(SDo02r;zSs{6hFJ?+)Ecc9Xk)dIwmW`-H6E)F|}$w>A?!;LE8kI zMB?bT?6yT}3SN(4PYuVe{GAQfcuFE{xk79FXQ#Gy^YB1r~-MV8o?<=0E~h zd!8U-kozxe9h(PU4qFR2oJdC@SQ8AdAjI2B+Ff)NHiL}}c;UboVkPvbqT3N>JVI2B~+a3m@{QFkf?QXlf z8Ae)O09V;A*X2~5{`F)uA}lLRuF31s%f(yA2N$32sOeJSp7C8uVlcsJ@yG&<7(8jb@!{{P|eVmr;E)%(? znb7khK}#AX&T=kNkx+)u>MW=BR;mQ6;>+D*MSUP_B+Oq%taW_O)RhR{oG{Hm?}zok zsP=^QMq_yEQ(SMnU3<3UmRLoJnaLBYVqNd0t&f7o^@ZrbM-}=Wt`E9oDLRpA#qx^r zI#5I}b9(aO)B88?jxP51AY0m>i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l+m#m%5WbzBS6EwO^~}3b+sqgM!2KG8~>;h@QY)!_Wm!iV~A}c(j1hXazb1#x(UQ_f9xIn;c-+$h@_=31B4>&;C-#EnYBq$@T6<2P%q3fD0^ zH{ZVD?BKTe^8M?{&*WfddGg}ooV`f)KYclv^X%2~(_wjke7biuKE6GCf5i@7{`2K{ zZ+rjcyIpo+cFo@N-7~hkWV?6e;{8o_{o&|t_w?}oBBhh(n!P#DHy@ABZ_YpGU#EpS z*30`>hhM)0)dBh_4%r30%NCP-BnH8iKXbw?#iffW-}XSB7&TkW;rVC6?lXU9=8V=T(jPN)-mbaRe2H zUpq#lIFfszu%}Op7Q>sT;SggDj{~Fj5GcTYIgPf~rg8|!eb(4#wrp?!`Cde%u z$HnM!<^k%}neEZ1kCB4T7NCnzb64;I))rm+Ev+%ko8x##*tRV&b%_I6G3Jqah6@hy z*VwtG9l4@qC2kBBKyO9~xWBcf{V?1y8fOyBxF3PZ@TUb;$gzUM7nZo)K;YMzLqM(5 z!5|^DDe26>M{Pk(=fllVXY2R0!PbMpjX!X?)EH`P{WcY_i?~5O*qT~F)RcZd`46m# Bpl$#F literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.create.1.json new file mode 100644 index 0000000000000000000000000000000000000000..2d44c876a7091810ffbe8ae858af71db03b357a8 GIT binary patch literal 930 zcmaJ=O>Yx15WVMDM0@725l9GbKng@OO-d<(AY@JL*~F>8;*TaJ%716|wPY zzj^cK&Fp?K99H0*k{qJ6rg}XzNvUTgoTAkf<;=mOMiZIFxUwR2K^zQ6rAjjM2%*ox zmCT6&xyML(Rlq3OXm1i)gAmQk9Ii3Q$nth(WxtuI6#snL+$pQoS(w(>5 zD7$4sdgS@0*Qm^u{x83!RuFQ-F*%0b+brXcrQ{RREyRf0o&2EF6G!mot*Ec$;z%hU zP+NgS)qo0E+SFhK(RJx*K0q;`*#1yJ26t4hbkhaeyEU~)k=zgol_t`d+G5tQJ6wTk zm~FZ_{Uyk`PCwE8VOKw2eft6}RX>GsYZ|#szFihUVx{VNe1^AWJ{hs6eWXR@;PVvP z6P=G1u)n~Q(*5w>YaQV98P92^F}0SuuiN&o-= literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.list.1.json new file mode 100644 index 0000000000000000000000000000000000000000..2f0dae694d479c48bfa8f4f68c40beb0175147c2 GIT binary patch literal 1116 zcmaJ=+iDvz5PkPoEP5^^hLDoJ1)K(lws8t6#U+TbcGgy+l{UIKO^pA&GxFMNubb?{ zBIbJLoSD_2C`1Vn#Fyd^y^CU%|73-xF?&XUt6V?OO%DY}|GN;dFXqm8o0xNv3Y z2P&`%jmbr%M+nEYl+j!upz;_gUj&R=4sY)-CezW?9eDRVdJH9ey{kVjrfr;@jGvb7 zY&sjA-=F+93u*iWJtJE&9@B9>Hmc)I;MX9_e3dTy&ykUwsJe!u)S zo?eY8bl4RsF(|K_|4~sH_aaN}QL*=k0L`609;s_%ATSXzH4?pd4C{b);t?qVV#K;( zt`5C=iM1<{>=l@RyD4k1q%hkL;z=@Sm0zuQ!505ghdfL_!Ob3NO0x1igi+f_%60Ia zl`~v`sidp=xrcl5u~#Z*D?LwsvonbvSCfz_h{&JoDdK$kwv4m$1(Y zUx2U}Uz~sHq0BCi&xtjN3y&yEUdQB_S^?Xe5bc!|#kzfU?Djy%*9IB#=JIlb47tsF z*r^h%l*OOh;7! literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--SetupIntent.retrieve.1.json new file mode 100644 index 0000000000000000000000000000000000000000..2d44c876a7091810ffbe8ae858af71db03b357a8 GIT binary patch literal 930 zcmaJ=O>Yx15WVMDM0@725l9GbKng@OO-d<(AY@JL*~F>8;*TaJ%716|wPY zzj^cK&Fp?K99H0*k{qJ6rg}XzNvUTgoTAkf<;=mOMiZIFxUwR2K^zQ6rAjjM2%*ox zmCT6&xyML(Rlq3OXm1i)gAmQk9Ii3Q$nth(WxtuI6#snL+$pQoS(w(>5 zD7$4sdgS@0*Qm^u{x83!RuFQ-F*%0b+brXcrQ{RREyRf0o&2EF6G!mot*Ec$;z%hU zP+NgS)qo0E+SFhK(RJx*K0q;`*#1yJ26t4hbkhaeyEU~)k=zgol_t`d+G5tQJ6wTk zm~FZ_{Uyk`PCwE8VOKw2eft6}RX>GsYZ|#szFihUVx{VNe1^AWJ{hs6eWXR@;PVvP z6P=G1u)n~Q(*5w>YaQV98P92^F}0SuuiN&o-= literal 0 HcmV?d00001 diff --git a/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/migrate_customer_server_to_realms_and_upgrade--checkout.Session.create.1.json new file mode 100644 index 0000000000000000000000000000000000000000..fb711607980ed9d6921982ba9b9044421bc4873c GIT binary patch literal 2379 zcmb_dT~i`C6n&pxVfEJT(<;*72UBIu4l0a{;s65zTU)7++=iBP(k5vYE&u!8^p}9l z)2>f=liYjmx#ymK{j|5|(ZGTx@EnJl+E7XF^PWtE_%l5dLOqdKt4O&c!W0LyaUoKP zw8SJct1J~ejy}c{t0Jt#h^5c?;1vrY43KmtfMXz_!hkD}QDdo1ii#L|OJU7IAwoGP zlyeQnAS@w(ZG&f2G7u!u4wkpDHvU|x7!bii8H>*kEEsD*KZ34kpdzYN{RR!{ez4zQ z+~2RC(As|E@UXhi>l{v5?bNTsVI_&@nsTUoiKtAdAR=TS4G{d7&LIM6&(aS5up#KP zs+S^WBE$otApi{si-fMzlIQ%`0MlSM4iu)AyF$Ne8auHmjn%{AFGG-MS9!IOJ&$27 zi7c3{>9fS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LNGBnw_z)uPy~xYx)2CkIcJVB4Jj;xK?P4hF$iiosa~cDpujF7m(C+tQxr## zg?R;3SEYD{**MCYQEC7p8d4db14pG+w?IIX!QvVe0}FIrmLepV{=*9*0(95i5uQKnGlkSY{mQ zx%DI9Nrloy&7NYe!O1d|+#nzshZ8rS`KKVq=hjnGU`aEgz~UH10lb9Ua3yC_^}BvFj+1RS>RtDGH}`FHbM=uyoqT%i6Kl*-I)(1t&xPEO?u>aztJj>pU5{FjxGle+uhM|Z8#2v-ygO+t;Jl9D)b3A##35pPwB#CAVc~x zx|~b=&^^bp{@NeDmPf1HV}t!xG-^a4JVP(IY2^1FonpTWyXylu5ssSWC;R~SS4Q$j zrBNZxdbQQ-i{ None: + remote_server = RemoteZulipServer.objects.get(hostname="demo.example.com") + server_billing_session = RemoteServerBillingSession(remote_server=remote_server) + + # Migrate server to legacy plan. + with time_machine.travel(self.now, tick=False): + start_date = timezone_now() + end_date = add_months(start_date, months=3) + server_billing_session.migrate_customer_to_legacy_plan(start_date, end_date) + + server_customer = server_billing_session.get_customer() + assert server_customer is not None + server_customer_plan = get_current_plan_by_customer(server_customer) + assert server_customer_plan is not None + self.assertEqual(server_customer_plan.tier, CustomerPlan.TIER_SELF_HOSTED_LEGACY) + self.assertEqual(server_customer_plan.status, CustomerPlan.ACTIVE) + self.assertEqual(remote_server.plan_type, RemoteZulipServer.PLAN_TYPE_SELF_MANAGED_LEGACY) + + # Upload data. Performs customer migration from server to realms. + with time_machine.travel(self.now, tick=False): + self.add_mock_response() + send_server_data_to_push_bouncer(consider_usage_statistics=False) + + remote_server.refresh_from_db() + server_customer_plan.refresh_from_db() + self.assertEqual(server_customer_plan.status, CustomerPlan.ENDED) + self.assertEqual(remote_server.plan_type, RemoteZulipServer.PLAN_TYPE_SELF_MANAGED) + + remote_realms = RemoteRealm.objects.filter( + server=remote_server, + plan_type=RemoteRealm.PLAN_TYPE_SELF_MANAGED_LEGACY, + is_system_bot_realm=False, + ) + for remote_realm in remote_realms: + customer = Customer.objects.get(remote_realm=remote_realm) + customer_plan = get_current_plan_by_customer(customer) + assert customer_plan is not None + self.assertEqual(customer_plan.tier, CustomerPlan.TIER_SELF_HOSTED_LEGACY) + self.assertEqual(customer_plan.status, CustomerPlan.ACTIVE) + + self.login("hamlet") + hamlet = self.example_user("hamlet") + billing_base_url = self.billing_session.billing_base_url + + # Login + result = self.execute_remote_billing_authentication_flow(hamlet) + self.assertEqual(result.status_code, 302) + self.assertEqual(result["Location"], f"{billing_base_url}/plans/") + + # upgrade to business plan + with time_machine.travel(self.now, tick=False): + result = self.client_get(f"{billing_base_url}/upgrade/", subdomain="selfhosting") + self.assertEqual(result.status_code, 200) + self.assert_in_success_response(["Add card", "Purchase Zulip Business"], result) + + with time_machine.travel(self.now, tick=False): + stripe_customer = self.add_card_and_upgrade() + + zulip_realm_customer = Customer.objects.get(stripe_customer_id=stripe_customer.id) + zulip_realm_plan = CustomerPlan.objects.get( + customer=zulip_realm_customer, status=CustomerPlan.ACTIVE + ) + self.assertEqual(zulip_realm_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS) + + realm_user_count = UserProfile.objects.filter( + realm=hamlet.realm, is_bot=False, is_active=True + ).count() + licenses = max( + realm_user_count, self.billing_session.min_licenses_for_plan(zulip_realm_plan.tier) + ) + with time_machine.travel(self.now + timedelta(days=1), tick=False): + response = self.client_get(f"{billing_base_url}/billing/", subdomain="selfhosting") + for substring in [ + "Zulip Business", + "Number of licenses", + f"{licenses} (managed automatically)", + "Your plan will automatically renew on", + "January 2, 2013", + f"${80 * licenses:,.2f}", + "Visa ending in 4242", + "Update card", + ]: + self.assert_in_response(substring, response) + + # Login again + result = self.execute_remote_billing_authentication_flow( + hamlet, first_time_login=False, expect_tos=False, confirm_tos=False + ) + self.assertEqual(result.status_code, 302) + self.assertEqual(result["Location"], f"{billing_base_url}/billing/") + + # Downgrade + with self.assertLogs("corporate.stripe", "INFO") as m: + with time_machine.travel(self.now + timedelta(days=7), tick=False): + response = self.client_billing_patch( + "/billing/plan", + {"status": CustomerPlan.DOWNGRADE_AT_END_OF_CYCLE}, + ) + expected_log = f"INFO:corporate.stripe:Change plan status: Customer.id: {zulip_realm_customer.id}, CustomerPlan.id: {zulip_realm_plan.id}, status: {CustomerPlan.DOWNGRADE_AT_END_OF_CYCLE}" + self.assertEqual(m.output[0], expected_log) + self.assert_json_success(response) + zulip_realm_plan.refresh_from_db() + self.assertEqual(zulip_realm_plan.licenses_at_next_renewal(), None) + @override_settings(PUSH_NOTIFICATION_BOUNCER_URL="https://push.zulip.org.example.com") class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase): diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.py index b58a1d397a..b91716779b 100644 --- a/corporate/views/billing_page.py +++ b/corporate/views/billing_page.py @@ -264,7 +264,7 @@ def update_plan_for_remote_realm( "licenses_at_next_renewal", json_validator=check_int, default=None ), schedule: Optional[int] = REQ("schedule", json_validator=check_int, default=None), -) -> HttpResponse: # nocoverage +) -> HttpResponse: update_plan_request = UpdatePlanRequest( status=status, licenses=licenses, diff --git a/zilencer/views.py b/zilencer/views.py index 28832e857b..b001d806d8 100644 --- a/zilencer/views.py +++ b/zilencer/views.py @@ -822,7 +822,7 @@ def update_remote_realm_data_for_server( RemoteRealmAuditLog.objects.bulk_create(remote_realm_audit_logs) -def get_human_user_realm_uuids(realms: List[RealmDataForAnalytics]) -> List[UUID]: # nocoverage +def get_human_user_realm_uuids(realms: List[RealmDataForAnalytics]) -> List[UUID]: billable_realm_uuids = [] for realm in realms: # TODO: Remove the `zulipinternal` string_id check once no server is on 8.0-beta. @@ -831,7 +831,7 @@ def get_human_user_realm_uuids(realms: List[RealmDataForAnalytics]) -> List[UUID or realm.deactivated or realm.host.startswith("zulipinternal.") or (settings.DEVELOPMENT and realm.host.startswith("analytics.")) - ): + ): # nocoverage continue billable_realm_uuids.append(realm.uuid)