예제 #1
0
def test_request_supports_dynamic_attributes():
    request = Request('GET', b'/', None)
    foo = object()

    assert hasattr(request, 'foo') is False, 'This test makes sense if such attribute is not defined'
    request.foo = foo
    assert request.foo is foo
예제 #2
0
def test_request_supports_dynamic_attributes():
    request = Request("GET", b"/", None)
    foo = object()

    assert (hasattr(request, "foo") is
            False), "This test makes sense if such attribute is not defined"
    request.foo = foo  # type: ignore
    assert request.foo is foo  # type: ignore