def test_cache_control_set_control_obj_is_not_None(): class DummyCacheControl(object): def __init__(self): self.header_value = 1 self.properties = {'bleh': 1} res = Response() res._cache_control_obj = DummyCacheControl() res.cache_control = {} assert res.cache_control.properties == {}
def test_cache_control_set_None(): res = Response() res.cache_control = None assert repr(res.cache_control) == "<CacheControl ''>"
def test_cache_control_set_unicode(): res = Response() res.cache_control = text_(b'abc') assert repr(res.cache_control) == "<CacheControl 'abc'>"
def test_cache_control_set_unicode(): res = Response() res.cache_control = text_(b'abc') eq_(repr(res.cache_control), "<CacheControl 'abc'>")
def test_cache_control_set_dict(): res = Response() res.cache_control = {'a': 'b'} assert repr(res.cache_control) == "<CacheControl 'a=b'>"
def test_cache_control_set_None(): res = Response() res.cache_control = None eq_(repr(res.cache_control), "<CacheControl ''>")
def test_cache_control_set_dict(): res = Response() res.cache_control = {'a': 'b'} eq_(repr(res.cache_control), "<CacheControl 'a=b'>")
def test_cache_control_set_unicode(): res = Response() res.cache_control = text_(b'abc') eq_(repr(res.cache_control), "<CacheControl 'abc'>")
def test_cache_control_set_None(): res = Response() res.cache_control = None eq_(repr(res.cache_control), "<CacheControl ''>")
def test_cache_control_set_dict(): res = Response() res.cache_control = {'a':'b'} eq_(repr(res.cache_control), "<CacheControl 'a=b'>")