#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# cinder : ( 'volume_encryption_type_get' , 'volume_type_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_type_encryption_detail_view_encrypted( self ) : #NEWLINE# #INDENT# volume_type = self . volume_types . first ( ) #NEWLINE# volume_type . id = '1' #NEWLINE# volume_type . name = 'An Encrypted Volume Name' #NEWLINE# volume_type_list = [ volume_type ] #NEWLINE# vol_enc_type = self . cinder_volume_encryption_types . list ( ) [ 0 ] #NEWLINE# cinder . volume_encryption_type_get ( IsA ( http . HttpRequest ) , volume_type . id ) . AndReturn ( vol_enc_type ) #NEWLINE# cinder . volume_type_list ( IsA ( http . HttpRequest ) ) . AndReturn ( volume_type_list ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# url = reverse ( 'horizon:admin:volumes:volume_types:type_encryption_detail' , args = [ volume_type . id ] ) #NEWLINE# res = self . client . get ( url ) #NEWLINE# self . assertTemplateUsed ( res , 'admin/volumes/volume_types/volume_encryption_type_detail.html' ) #NEWLINE# self . assertContains ( res , '<h3>Volume Type Encryption Overview</h3>' , 1 , 200 ) #NEWLINE# self . assertContains ( res , ( '<dd>%s</dd>' % volume_type . name ) , 1 , 200 ) #NEWLINE# self . assertContains ( res , ( '<dd>%s</dd>' % vol_enc_type . control_location ) , 1 , 200 ) #NEWLINE# self . assertContains ( res , ( '<dd>%s</dd>' % vol_enc_type . key_size ) , 1 , 200 ) #NEWLINE# self . assertContains ( res , ( '<dd>%s</dd>' % vol_enc_type . provider ) , 1 , 200 ) #NEWLINE# self . assertContains ( res , ( '<dd>%s</dd>' % vol_enc_type . cipher ) , 1 , 200 ) #NEWLINE# self . assertNoMessages ( )