<s> from __future__ import absolute_import <EOL> from freight . api . serializer import serialize <EOL> from freight . models import TaskStatus <EOL> from freight . testutils import TestCase <EOL> class DeploySerializerTest ( TestCase ) : <EOL> def test_locked ( self ) : <EOL> user = self . create_user ( ) <EOL> repo = self . create_repo ( ) <EOL> app = self . create_app ( repository = repo ) <EOL> self . create_taskconfig ( app = app ) <EOL> task = self . create_task ( app = app , user = user , status = TaskStatus . pending ) <EOL> deploy = self . create_deploy ( app = app , task = task ) <EOL> result = serialize ( deploy ) <EOL> assert result [ '<STR_LIT:id>' ] == str ( deploy . id ) <EOL> assert result [ '<STR_LIT:status>' ] == '<STR_LIT>' <EOL> assert result [ '<STR_LIT>' ] == task . ref <EOL> assert result [ '<STR_LIT>' ] == task . sha <EOL> assert result [ '<STR_LIT>' ] == deploy . environment <EOL> assert result [ '<STR_LIT>' ] == deploy . number <EOL> assert result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] == str ( app . id ) <EOL> assert result [ '<STR_LIT>' ] [ '<STR_LIT:name>' ] == app . name </s>
