Exemplo n.º 1
0
def test_next_url_basic():
    path = "/one/two"
    request = RequestFactory().get(path)
    assert path == next_url(request)["next_url"]()
Exemplo n.º 2
0
def test_next_url_already_on_login_url(settings):
    path = reverse(settings.LOGIN_URL)
    request = RequestFactory().get(path)
    assert next_url(request)["next_url"]() is None
Exemplo n.º 3
0
def test_next_url_with_next_querystring():
    path = "/one/two?next=/foo/bar"
    request = RequestFactory().get(path)
    assert next_url(request)["next_url"]() == "/foo/bar"
Exemplo n.º 4
0
def test_next_url_with_next_querystring_but_remote():
    path = "/one/two?next=http://foo/bar"
    request = RequestFactory().get(path)
    assert next_url(request)["next_url"]() is None
Exemplo n.º 5
0
def test_next_url_querystring():
    path = "/one/two?something"
    request = RequestFactory().get(path)
    assert path == next_url(request)["next_url"]()