示例#1
0
def test_unknown_theme_fails(rf):
    request = rf.get("/", {"theme": printable_gibberish()})
    request.user = SuperUser()
    with pytest.raises(Problem):
        EditorView.as_view()(request)
示例#2
0
def test_anon_cant_edit(rf):
    request = rf.get("/")
    request.user = AnonymousUser()
    with pytest.raises(Problem):
        EditorView.as_view()(request)
示例#3
0
def test_unknown_theme_fails(rf):
    request = rf.get("/", {"theme": printable_gibberish()})
    request.user = SuperUser()
    with pytest.raises(Problem):
        EditorView.as_view()(request)
示例#4
0
def test_anon_cant_edit(rf):
    request = rf.get("/")
    request.user = AnonymousUser()
    with pytest.raises(Problem):
        EditorView.as_view()(request)
示例#5
0
文件: urls.py 项目: cuberskulk/shoop
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.conf.urls import url
from shoop.xtheme.views.command import command_dispatch
from shoop.xtheme.views.editor import EditorView
from shoop.xtheme.views.extra import extra_view_dispatch

urlpatterns = [
    url(r"^xtheme/editor/$", EditorView.as_view(), name="xtheme_editor"),
    url(r"^xtheme/(?P<view>.+)/*$", extra_view_dispatch, name="xtheme_extra_view"),
    url(r"^xtheme/$", command_dispatch, name="xtheme"),
]
示例#6
0
文件: urls.py 项目: krisera/shoop
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.conf.urls import url
from shoop.xtheme.views.command import command_dispatch
from shoop.xtheme.views.editor import EditorView
from shoop.xtheme.views.extra import extra_view_dispatch

urlpatterns = [
    url(r"^xtheme/editor/$", EditorView.as_view(), name="xtheme_editor"),
    url(r"^xtheme/(?P<view>.+)/*$",
        extra_view_dispatch,
        name="xtheme_extra_view"),
    url(r"^xtheme/$", command_dispatch, name="xtheme"),
]