<s> from __future__ import unicode_literals <EOL> import collections <EOL> import functools <EOL> from . import base <EOL> class TestCase ( base . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def assertCookiesInclude ( self , response , names ) : <EOL> """<STR_LIT>""" <EOL> self . assertTrue ( <EOL> hasattr ( response , "<STR_LIT>" ) and response . cookies , <EOL> "<STR_LIT>" ) <EOL> self . assertKeysIn ( names , response . cookies ) <EOL> def assertCookiesExclude ( self , response , names ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( response , "<STR_LIT>" ) and response . cookies : <EOL> self . assertKeysNotIn ( names , response . cookies ) <EOL> def assertCookiesExact ( self , response , cookies ) : <EOL> """<STR_LIT>""" <EOL> self . assertTrue ( <EOL> hasattr ( response , "<STR_LIT>" ) and response . cookies , <EOL> "<STR_LIT>" ) <EOL> self . assertItemsExact ( response . cookies , cookies ) <EOL> def create_cookie_assertions ( self , include = None , exclude = None , exact = None ) : <EOL> """<STR_LIT>""" <EOL> include = include or ( ) <EOL> exclude = exclude or ( ) <EOL> exact = ( <EOL> exact <EOL> if isinstance ( exact , collections . Mapping ) <EOL> else dict ( exact or { } ) ) <EOL> return ( <EOL> ( ( functools . partial ( self . assertCookiesInclude , names = include ) , ) <EOL> if include <EOL> else ( ) ) + <EOL> ( ( functools . partial ( self . assertCookiesExclude , names = exclude ) , ) <EOL> if exclude <EOL> else ( ) ) + <EOL> ( ( functools . partial ( self . assertCookiesExact , cookies = exact ) , ) <EOL> if exact <EOL> else ( ) ) ) <EOL> def create_response_assertions ( self , cookies_include = None , <EOL> cookies_exclude = None , cookies_exact = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return ( <EOL> self . create_cookie_assertions ( <EOL> include = cookies_include , <EOL> exclude = cookies_exclude , <EOL> exact = cookies_exact ) + <EOL> super ( TestCase , self ) . create_response_assertions ( ** kwargs ) ) </s>
