예제 #1
0
파일: views_test.py 프로젝트: djcun95/h
    def test_redirects_if_slug_incorrect(self, pyramid_request):
        group = FakeGroup('abc123', 'some-slug')
        pyramid_request.matchdict['slug'] = 'another-slug'

        with pytest.raises(HTTPMovedPermanently) as exc:
            views.read_unauthenticated(group, pyramid_request)

        assert exc.value.location == '/g/abc123/some-slug'
예제 #2
0
    def test_redirects_if_slug_incorrect(self, pyramid_request):
        group = FakeGroup('abc123', 'some-slug')
        pyramid_request.matchdict['slug'] = 'another-slug'

        with pytest.raises(HTTPMovedPermanently) as exc:
            views.read_unauthenticated(group, pyramid_request)

        assert exc.value.location == '/g/abc123/some-slug'
예제 #3
0
파일: views_test.py 프로젝트: djcun95/h
    def test_returns_template_context(self, pyramid_request):
        group = FakeGroup('abc123', 'some-slug')
        pyramid_request.matchdict['slug'] = 'some-slug'

        result = views.read_unauthenticated(group, pyramid_request)

        assert result == {'group': group}
예제 #4
0
    def test_returns_template_context(self, pyramid_request):
        group = FakeGroup('abc123', 'some-slug')
        pyramid_request.matchdict['slug'] = 'some-slug'

        result = views.read_unauthenticated(group, pyramid_request)

        assert result == {'group': group}