예제 #1
0
def test_serialize_if_range_datetime():
    import datetime
    from webob.descriptors import serialize_if_range

    UTC = GMT()
    val = serialize_if_range(datetime.datetime(1994, 11, 15, 8, 12, 31, tzinfo=UTC))
    eq_(val, "Tue, 15 Nov 1994 08:12:31 GMT")
예제 #2
0
def test_serialize_if_range_datetime():
    import datetime
    from webob.descriptors import serialize_if_range
    UTC = GMT()
    val = serialize_if_range(
        datetime.datetime(1994, 11, 15, 8, 12, 31, tzinfo=UTC))
    eq_(val, "Tue, 15 Nov 1994 08:12:31 GMT")
예제 #3
0
def test_serialize_if_range_other():
    from webob.descriptors import serialize_if_range

    val = serialize_if_range(123456)
    assert val == "123456"
예제 #4
0
def test_serialize_if_range_unicode():
    from webob.descriptors import serialize_if_range

    val = serialize_if_range("avalue")
    assert val == "avalue"
예제 #5
0
def test_serialize_if_range_other():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range(123456)
    assert val == '123456'
예제 #6
0
def test_serialize_if_range_unicode():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range("avalue")
    assert val == "avalue"
예제 #7
0
def test_serialize_if_range_other():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range(123456)
    eq_(val, '123456')
예제 #8
0
def test_serialize_if_range_string():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range("avalue")
    eq_(val, "avalue")
예제 #9
0
def test_serialize_if_range_other():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range(123456)
    eq_(val, '123456')
예제 #10
0
def test_serialize_if_range_unicode():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range(u"avalue")
    eq_(val, u"avalue")
예제 #11
0
def test_serialize_if_range_string():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range("avalue")
    eq_(val, "avalue")
예제 #12
0
def test_serialize_if_range_unicode():
    from webob.descriptors import serialize_if_range
    val = serialize_if_range(u"avalue")
    eq_(val, u"avalue")