Commit b559029
committed
[tests] Fix deactivation test to exercise correct code path #1221
test_deactivation_fires_post_delete_signals was calling
device.config.templates.clear() directly without first setting the
config status to deactivating. This meant the per-instance delete
path guarded by is_deactivating_or_deactivated() in manage_vpn_clients
was never exercised, defeating the purpose of the regression test.
Replace templates.clear() with device.deactivate() which sets the
status to deactivating before clearing templates. Also replace the
conditional handler.assert_called() with an unconditional
handler.assert_called_once() and add an IP release assertion.
Remove unused variable cert (F841).
Related to #12211 parent d60ec13 commit b559029
1 file changed
+6
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
891 | 890 | | |
892 | 891 | | |
893 | 892 | | |
| |||
907 | 906 | | |
908 | 907 | | |
909 | 908 | | |
910 | | - | |
911 | | - | |
912 | | - | |
| 909 | + | |
913 | 910 | | |
914 | 911 | | |
915 | 912 | | |
| |||
919 | 916 | | |
920 | 917 | | |
921 | 918 | | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
| 919 | + | |
| 920 | + | |
927 | 921 | | |
928 | 922 | | |
929 | 923 | | |
930 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
931 | 928 | | |
932 | 929 | | |
933 | 930 | | |
| |||
0 commit comments