@@ -614,6 +614,12 @@ def test_download_template_config(self):
614
614
response = self .client .get (path )
615
615
self .assertEqual (response .get ('content-type' ), 'application/octet-stream' )
616
616
617
+ def test_template_has_download_config (self ):
618
+ t = Template .objects .first ()
619
+ path = reverse (f'admin:{ self .app_label } _template_change' , args = [t .pk ])
620
+ r = self .client .get (path )
621
+ self .assertContains (r , 'Download configuration' )
622
+
617
623
def test_preview_template (self ):
618
624
template = Template .objects .get (name = 'radio0' )
619
625
path = reverse (f'admin:{ self .app_label } _template_preview' )
@@ -759,6 +765,12 @@ def test_download_vpn_config(self):
759
765
response = self .client .get (path )
760
766
self .assertEqual (response .get ('content-type' ), 'application/octet-stream' )
761
767
768
+ def test_vpn_has_download_config (self ):
769
+ v = self ._create_vpn ()
770
+ path = reverse (f'admin:{ self .app_label } _vpn_change' , args = [v .pk ])
771
+ r = self .client .get (path )
772
+ self .assertContains (r , 'Download configuration' )
773
+
762
774
def test_preview_vpn (self ):
763
775
v = self ._create_vpn ()
764
776
path = reverse (f'admin:{ self .app_label } _vpn_preview' )
@@ -810,6 +822,14 @@ def test_error_if_download_config(self):
810
822
)
811
823
self .assertNotContains (res , 'Download configuration' )
812
824
825
+ def test_device_has_download_config (self ):
826
+ d = self ._create_device ()
827
+ t = Template .objects .first ()
828
+ self ._create_config (device = d , backend = t .backend , config = t .config )
829
+ path = reverse (f'admin:{ self .app_label } _device_change' , args = [d .pk ])
830
+ r = self .client .get (path )
831
+ self .assertContains (r , 'Download configuration' )
832
+
813
833
def test_preview_device_with_context (self ):
814
834
path = reverse (f'admin:{ self .app_label } _device_preview' )
815
835
config = json .dumps (
0 commit comments