Beispiel #1
0
def test_handle_bad_request():
    """ handle_request must return a HttpResponse """
    router = MockRouter()
    backend = RapidHttpBacked(name='test', 
                              router=router)
    response = backend.handle_request(HttpRequest())
    assert_true(isinstance(response, HttpResponseBadRequest))
Beispiel #2
0
def test_handle_good_request():
    """ handle_request must return a HttpResponse """
    router = MockRouter()
    backend = RapidHttpBacked(name='test', 
                              router=router)
    http_request = HttpRequest()
    http_request.GET = {'id':'123','text':'message'}
    response = backend.handle_request(http_request)
    assert_true(isinstance(response, HttpResponse))