#NEWLINE# def test_current_ref( self ) : #NEWLINE# #INDENT# current = self . create_task ( app = self . app , user = deploy . user , status = TaskStatus . finished , sha = uuid4 ( ) . hex ) #NEWLINE# self . create_deploy ( app = self . app , task = current , environment = 'staging' ) #NEWLINE# resp = self . client . post ( self . path , data = { #NEWLINE# #INDENT# 'env' : 'staging' , #NEWLINE# 'app' : self . app . name , #NEWLINE# 'user' : self . user . name , #NEWLINE# 'ref' : ':current' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 201 ) , resp . data #NEWLINE# data = json . loads ( resp . data ) #NEWLINE# assert data [ 'id' ] #NEWLINE# deploy = Deploy . query . get ( data [ 'id' ] ) #NEWLINE# task = Task . query . get ( deploy . task_id ) #NEWLINE# assert ( task . ref == ':current' ) #NEWLINE# assert ( task . sha == current . sha )