本文整理汇总了Python中the_tale.accounts.logic.login_page_url函数的典型用法代码示例。如果您正苦于以下问题:Python login_page_url函数的具体用法?Python login_page_url怎么用?Python login_page_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了login_page_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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), ))
示例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()))
示例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))
示例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
)
示例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))
示例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))
示例7: login_page_url
def login_page_url(next_url='/'):
return jinja2.Markup(logic.login_page_url(next_url))
示例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))
示例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'])
示例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))
示例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))
示例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)
示例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))
示例14: test_anonimouse_view
def test_anonimouse_view(self):
self.check_redirect(self.requested_url, accounts_logic.login_page_url(self.requested_url))
示例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))