def test_index_increments_stat(statsd): try: views.index(mock_request()) except: pass statsd.incr.assert_called_once_with( "views.index.302.redirected_to_hypothesis")
def test_index_redirects_to_hypothesis(): with pytest.raises(httpexceptions.HTTPFound) as exc: views.index(mock_request()) assert exc.value.location == "https://hypothes.is"