#NEWLINE# def test_add_alias( self ) : #NEWLINE# #INDENT# response = self . post ( '/admin/api/aliases/' , { #NEWLINE# #INDENT# 'url' : TEST_ALIAS , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 201 , response . status_code ) #NEWLINE# parsed_response_body = json . loads ( response . content ) #NEWLINE# alias_uuid = extract_uuid ( parsed_response_body [ 'id' ] ) #NEWLINE# self . assertRegexpMatches ( parsed_response_body [ 'id' ] , ( '^urn:uuid:%s$' % uid_regexp ( ) ) ) #NEWLINE# self . assertEqual ( TEST_ALIAS , parsed_response_body [ 'url' ] ) #NEWLINE# self_url = ( '%s/admin/api/aliases/%s/' % ( TEST_SITE , alias_uuid ) ) #NEWLINE# self . assertEqual ( self_url , parsed_response_body [ 'self' ] ) #NEWLINE# self . assertEqual ( self_url , response [ 'Location' ] ) #NEWLINE# self . assertEqual ( self_url , response [ 'Content-Location' ] )