本文整理汇总了Python中the_tale.accounts.logic.login_page_url函数的典型用法代码示例。如果您正苦于以下问题:Python login_page_url函数的具体用法?Python login_page_url怎么用?Python login_page_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了login_page_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_post_on_forum_unloggined
def test_post_on_forum_unloggined(self):
self.check_redirect(url('news:publish-on-forum', self.news1.id),
login_page_url(url('news:publish-on-forum', self.news1.id)))
self.assertEqual(forum_models.Thread.objects.all().count(), 0)
self.check_html_ok(self.client.get(url('news:show', self.news1.id)), texts=(('pgf-forum-link', 0), ))
self.check_html_ok(self.client.get(url('news:')), texts=(('pgf-forum-link', 0), ))
开发者ID:Alkalit,项目名称:the-tale,代码行数:8,代码来源:test_requests.py
示例2: wrapper
def wrapper(resource, *argv, **kwargs):
from the_tale.accounts.logic import login_page_url
if resource.account.is_authenticated():
return func(resource, *argv, **kwargs)
else:
from dext.common.utils.response import mime_type_to_response_type
response_type = mime_type_to_response_type(resource.request.META.get('HTTP_ACCEPT'))
if resource.request.is_ajax() or response_type == 'json':
return resource.auto_error('common.login_required', u'У Вас нет прав для проведения данной операции')
return resource.redirect(login_page_url(resource.request.get_full_path()))
开发者ID:IdenGit,项目名称:the-tale,代码行数:12,代码来源:decorators.py
示例3: test_unlogined_new_thread_page
def test_unlogined_new_thread_page(self):
request_url = url('forum:subcategories:new-thread', self.subcategory.id)
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:3,代码来源:test_moderation.py
示例4: test_unlogined
def test_unlogined(self):
self.request_logout()
request_url = reverse("game:artifacts:moderate", args=[self.artifact.id])
self.assertRedirects(
self.request_html(request_url), login_page_url(request_url), status_code=302, target_status_code=200
)
开发者ID:Tiendil,项目名称:the-tale,代码行数:6,代码来源:test_requests.py
示例5: test_unlogined
def test_unlogined(self):
self.request_logout()
request_url = reverse("game:mobs:new")
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Tiendil,项目名称:the-tale,代码行数:4,代码来源:test_request.py
示例6: test_unloginned
def test_unloginned(self):
self.request_logout()
request_url = url('game:heroes:my-hero')
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Jazzis18,项目名称:the-tale,代码行数:4,代码来源:test_requests.py
示例7: login_page_url
def login_page_url(next_url='/'):
return jinja2.Markup(logic.login_page_url(next_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:2,代码来源:jinjaglobals.py
示例8: test_unlogined
def test_unlogined(self):
self.request_logout()
url = reverse("blogs:posts:edit", args=[self.post.id])
self.check_redirect(url, login_page_url(url))
开发者ID:Tiendil,项目名称:the-tale,代码行数:4,代码来源:test_requests.py
示例9: test_no_rights
def test_no_rights(self):
self.check_redirect(url('news:new'), login_page_url(url('news:new')))
self.request_login(self.user.email)
self.check_html_ok(self.request_html(url('news:new')), texts=['news.no_edit_rights'])
开发者ID:Alkalit,项目名称:the-tale,代码行数:4,代码来源:test_requests.py
示例10: test_edit_page_unlogined
def test_edit_page_unlogined(self):
request_url = url('forum:posts:edit', self.post.id)
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:3,代码来源:test_moderation.py
示例11: test_unlogined_user_edit_theme_page
def test_unlogined_user_edit_theme_page(self):
request_url = url('forum:threads:edit', self.thread.id)
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:3,代码来源:test_moderation.py
示例12: test_unlogined
def test_unlogined(self):
self.request_logout()
request_url = reverse('game:artifacts:new')
self.assertRedirects(self.request_html(request_url), login_page_url(request_url), status_code=302, target_status_code=200)
开发者ID:Alkalit,项目名称:the-tale,代码行数:4,代码来源:test_requests.py
示例13: test_logic_required
def test_logic_required(self):
self.request_logout()
word_type = utg_relations.WORD_TYPE.records[0]
requested_url = url('linguistics:words:new', type=word_type.value, parent='xxx')
self.check_redirect(requested_url, login_page_url(requested_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:5,代码来源:test_words_requests.py
示例14: test_anonimouse_view
def test_anonimouse_view(self):
self.check_redirect(self.requested_url, accounts_logic.login_page_url(self.requested_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:2,代码来源:test_requests.py
示例15: test_choose_ability_dialog_anonymous
def test_choose_ability_dialog_anonymous(self):
request_url = reverse("game:heroes:choose-ability-dialog", args=[self.hero.id])
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Jazzis18,项目名称:the-tale,代码行数:3,代码来源:test_habilities.py
示例16: test_game_page_unlogined
def test_game_page_unlogined(self):
self.request_logout()
self.check_redirect(reverse('game:'), login_page_url(reverse('game:')))
开发者ID:Alkalit,项目名称:the-tale,代码行数:3,代码来源:test_requests.py
示例17: test_new_thread_unlogined
def test_new_thread_unlogined(self):
self.request_logout()
request_url = url('forum:subcategories:new-thread', self.subcat1.id)
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:4,代码来源:test_requests.py
示例18: test_login_required
def test_login_required(self):
request_url = reverse('portal:developers-info:mobs-and-artifacts')
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:3,代码来源:test_request.py
示例19: test_login_required
def test_login_required(self):
self.request_logout()
request_url = url('forum:subscriptions:')
self.check_redirect(request_url, login_page_url(request_url))
开发者ID:Alkalit,项目名称:the-tale,代码行数:4,代码来源:test_requests.py
示例20: test_profile_page_unlogined
def test_profile_page_unlogined(self):
self.check_redirect(reverse('accounts:profile:show'), login_page_url(reverse('accounts:profile:show')))
开发者ID:Alkalit,项目名称:the-tale,代码行数:2,代码来源:test_requests_profile.py
注:本文中的the_tale.accounts.logic.login_page_url函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论