#NEWLINE# @ mock . patch ( 'olympia.devhub.views.auto_sign_version' ) #NEWLINE# def test_version_is_beta_unlisted( self , sign_version ) : #NEWLINE# #INDENT# Addon . objects . get ( guid = self . guid ) . update ( status = amo . STATUS_LITE , is_listed = False ) #NEWLINE# version_string = '4.0-beta1' #NEWLINE# qs = Version . objects . filter ( addon__guid = self . guid , version = version_string ) #NEWLINE# assert ( not qs . exists ( ) ) #NEWLINE# response = self . put ( self . url ( self . guid , version_string ) , version = version_string ) #NEWLINE# assert ( response . status_code == 202 ) #NEWLINE# assert ( 'processed' in response . data ) #NEWLINE# version = qs . get ( ) #NEWLINE# assert ( version . addon . guid == self . guid ) #NEWLINE# assert ( version . version == version_string ) #NEWLINE# assert ( version . statuses [ 0 ] [ 1 ] == amo . STATUS_LITE ) #NEWLINE# assert ( version . addon . status == amo . STATUS_LITE ) #NEWLINE# assert ( not version . is_beta ) #NEWLINE# sign_version . assert_called_with ( version , is_beta = False )