Add test for the milla.allow decorator
parent
91f2d954e7
commit
47103b76a4
|
@ -394,3 +394,12 @@ def test_single_start_response():
|
||||||
assert start_response.call_count == 1, start_response.call_count
|
assert start_response.call_count == 1, start_response.call_count
|
||||||
assert response.headers.startswith('HTTP/1.1 200 OK'), response.headers
|
assert response.headers.startswith('HTTP/1.1 200 OK'), response.headers
|
||||||
assert response.body == 'test', response.body
|
assert response.body == 'test', response.body
|
||||||
|
|
||||||
|
def test_allow_decorator():
|
||||||
|
'''Ensure allow decorator sets allowed_methods on controllers'''
|
||||||
|
|
||||||
|
@milla.allow('GET', 'HEAD', 'POST')
|
||||||
|
def controller(request):
|
||||||
|
return 'success'
|
||||||
|
|
||||||
|
assert controller.allowed_methods == ('GET', 'HEAD', 'POST')
|
||||||
|
|
Loading…
Reference in New Issue