<s> from sqlalchemy . orm import subqueryload_all <EOL> from changes . api . base import APIView <EOL> from changes . models import LogSource , TestCase <EOL> class TestCaseDetailsAPIView ( APIView ) : <EOL> def get ( self , test_id ) : <EOL> testcase = TestCase . query . options ( <EOL> subqueryload_all ( '<STR_LIT>' ) <EOL> ) . get ( test_id ) <EOL> if testcase is None : <EOL> return '<STR_LIT>' , <NUM_LIT> <EOL> context = self . serialize ( testcase ) <EOL> context [ '<STR_LIT:message>' ] = testcase . message <EOL> context [ '<STR_LIT>' ] = self . serialize ( testcase . step ) <EOL> context [ '<STR_LIT>' ] = self . serialize ( testcase . artifacts ) <EOL> context [ '<STR_LIT>' ] = self . serialize ( LogSource . query . filter ( <EOL> LogSource . step_id == testcase . step_id , <EOL> ) . first ( ) ) <EOL> return self . respond ( context ) </s>
