Пример #1
0
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 == {}
Пример #2
0
def test_cache_control_set_None():
    res = Response()
    res.cache_control = None
    assert repr(res.cache_control) == "<CacheControl ''>"
Пример #3
0
def test_cache_control_set_unicode():
    res = Response()
    res.cache_control = text_(b'abc')
    assert repr(res.cache_control) == "<CacheControl 'abc'>"
Пример #4
0
def test_cache_control_set_unicode():
    res = Response()
    res.cache_control = text_(b'abc')
    eq_(repr(res.cache_control), "<CacheControl 'abc'>")
Пример #5
0
def test_cache_control_set_dict():
    res = Response()
    res.cache_control = {'a': 'b'}
    assert repr(res.cache_control) == "<CacheControl 'a=b'>"
Пример #6
0
def test_cache_control_set_None():
    res = Response()
    res.cache_control = None
    eq_(repr(res.cache_control), "<CacheControl ''>")
Пример #7
0
def test_cache_control_set_dict():
    res = Response()
    res.cache_control = {'a': 'b'}
    eq_(repr(res.cache_control), "<CacheControl 'a=b'>")
Пример #8
0
def test_cache_control_set_unicode():
    res = Response()
    res.cache_control = text_(b'abc')
    eq_(repr(res.cache_control), "<CacheControl 'abc'>")
Пример #9
0
def test_cache_control_set_None():
    res = Response()
    res.cache_control = None
    eq_(repr(res.cache_control), "<CacheControl ''>")
Пример #10
0
def test_cache_control_set_dict():
    res = Response()
    res.cache_control = {'a':'b'}
    eq_(repr(res.cache_control), "<CacheControl 'a=b'>")