本文整理汇总了Python中wagtail.tests.utils.login函数的典型用法代码示例。如果您正苦于以下问题:Python login函数的具体用法?Python login怎么用?Python login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了login函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
self.test_snippet = Advert()
self.test_snippet.text = 'test_advert'
self.test_snippet.url = 'http://www.example.com/'
self.test_snippet.save()
login(self.client)
示例2: setUp
def setUp(self):
# Create a redirect to edit
self.redirect = models.Redirect(old_path='/test', redirect_link='http://www.test.com/')
self.redirect.save()
# Login
login(self.client)
示例3: setUp
def setUp(self):
login(self.client)
# Create an image to edit
self.image = Image.objects.create(
title="Test image",
file=get_test_image_file(),
)
示例4: setUp
def setUp(self):
self.root_page = Page.objects.get(id=2)
# Add child page
self.child_page = SimplePage()
self.child_page.title = "foobarbaz"
self.child_page.slug = "foobarbaz"
self.root_page.add_child(instance=self.child_page)
login(self.client)
示例5: setUp
def setUp(self):
# Find root page
self.root_page = Page.objects.get(id=2)
# Add child page
self.child_page = SimplePage()
self.child_page.title = "Hello world!"
self.child_page.slug = "hello-world"
self.child_page.live = True
self.root_page.add_child(self.child_page)
self.child_page.save_revision()
# Add event page (to test edit handlers)
self.event_page = EventPage()
self.event_page.title = "Event page"
self.event_page.slug = "event-page"
self.root_page.add_child(self.event_page)
# Login
login(self.client)
示例6: setUp
def setUp(self):
self.homepage = Page.objects.get(id=2)
login(self.client)
示例7: setUp
def setUp(self):
login(self.client)
# Create an editors pick to delete
self.query = models.Query.get("Hello")
self.query.editors_picks.create(page_id=1, description="Root page")