#NEWLINE# def test_get_options_from_storage( self ) : #NEWLINE# #INDENT# image_url = '/some/image.jpg' #NEWLINE# custom_security_key = 'custom-sec' #NEWLINE# cryptor = Cryptor ( security_key = custom_security_key ) #NEWLINE# decryptor = Cryptor ( security_key = 'something' ) #NEWLINE# expected_options = dict ( width = 300 , height = 300 , smart = True , adaptive = False , full = False , fit_in = False , flip_horizontal = True , flip_vertical = True , halign = 'center' , valign = 'middle' , trim = True , crop_left = 10 , crop_top = 11 , crop_right = 12 , crop_bottom = 13 , filters = 'some_filter()' , image = image_url ) #NEWLINE# encrypted_str = cryptor . encrypt ( ** expected_options ) #NEWLINE# mock_storage = mock . Mock ( ) #NEWLINE# decryptor . context = mock . Mock ( config = mock . Mock ( STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True ) , modules = mock . Mock ( storage = mock_storage ) ) #NEWLINE# mock_storage . get_crypto . return_value = custom_security_key #NEWLINE# options = decryptor . get_options ( encrypted_str , image_url ) #NEWLINE# expect ( options ) . not_to_be_null ( ) #NEWLINE# expected_options = { #NEWLINE# #INDENT# 'trim' : 'trim' , #NEWLINE# 'full' : False , #NEWLINE# 'halign' : 'center' , #NEWLINE# 'fit_in' : False , #NEWLINE# 'vertical_flip' : True , #NEWLINE# 'image' : '/some/image.jpg' , #NEWLINE# 'crop' : { #NEWLINE# #INDENT# 'top' : 11 , #NEWLINE# 'right' : 12 , #NEWLINE# 'bottom' : 13 , #NEWLINE# 'left' : 10 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'height' : 300 , #NEWLINE# 'width' : 300 , #NEWLINE# 'meta' : False , #NEWLINE# 'horizontal_flip' : True , #NEWLINE# 'filters' : 'some_filter()' , #NEWLINE# 'valign' : 'middle' , #NEWLINE# 'debug' : False , #NEWLINE# 'hash' : 'e2baf424fa420b73a97476956dfb858f' , #NEWLINE# 'adaptive' : False , #NEWLINE# 'smart' : True , #NEWLINE# #UNINDENT# } #NEWLINE# expect ( options ) . to_be_like ( expected_options )