def test_read_noslug_redirects(pyramid_request): group = FakeGroup('abc123', 'some-slug') with pytest.raises(HTTPMovedPermanently) as exc: views.read_noslug(group, pyramid_request) assert exc.value.location == '/g/abc123/some-slug'
def test_read_noslug_redirects(pyramid_request): group = FakeGroup('abc123', 'some-slug') with pytest.raises(HTTPMovedPermanently) as exc: views.read_noslug(group, pyramid_request) assert exc.value.location == '/g/abc123/some-slug'
def test_read_noslug_redirects(pyramid_request, factories): group = factories.Group() with pytest.raises(HTTPMovedPermanently) as exc: views.read_noslug(GroupContext(group), pyramid_request) assert exc.value.location == f"/g/{group.pubid}/{group.slug}"