#NEWLINE# def assertCORSResponse( self , response , status = '200 OK' , allow_origin = None , max_age = None , allow_methods = None , allow_headers = None , allow_credentials = None , expose_headers = None , vary = 'Origin' , has_content_type = False ) : #NEWLINE# #INDENT# 'Test helper for CORS response headers.\n\n        Assert all the headers in a given response. By default, we assume\n        the response is empty.\n        ' #NEWLINE# self . assertEqual ( response . status , status ) #NEWLINE# self . assertHeader ( response , 'Access-Control-Allow-Origin' , allow_origin ) #NEWLINE# self . assertHeader ( response , 'Access-Control-Max-Age' , max_age ) #NEWLINE# self . assertHeader ( response , 'Access-Control-Allow-Methods' , allow_methods ) #NEWLINE# self . assertHeader ( response , 'Access-Control-Allow-Headers' , allow_headers ) #NEWLINE# self . assertHeader ( response , 'Access-Control-Allow-Credentials' , allow_credentials ) #NEWLINE# self . assertHeader ( response , 'Access-Control-Expose-Headers' , expose_headers ) #NEWLINE# if ( not has_content_type ) : #NEWLINE# #INDENT# self . assertHeader ( response , 'Content-Type' ) #NEWLINE# #UNINDENT# if allow_origin : #NEWLINE# #INDENT# self . assertHeader ( response , 'Vary' , vary )