def test_logout_class(self): # If browserid-logout isn't in the link_class argument, it should be # appended to it prior to calling browserid_button. button = browserid_logout(link_class='go button') a = pq(button)('a') self.assertTrue(a.hasClass('browserid-logout'))
def test_next(self): button = helpers.browserid_logout(next='/foo/bar') self.assertHTMLEqual(button, """ <a href="/browserid/logout/" class="browserid-logout" data-next="/foo/bar"> <span>Sign out</span> </a> """)
def test_logout_class(self): button = helpers.browserid_logout(link_class='go button') self.assertHTMLEqual(button, """ <a href="/browserid/logout/" class="go button browserid-logout" data-next=""> <span>Sign out</span> </a> """)
def test_next(self): button = helpers.browserid_logout(next='/foo/bar') self.assertHTMLEqual( button, """ <a href="/browserid/logout/" class="browserid-logout" data-next="/foo/bar"> <span>Sign out</span> </a> """)
def test_logout_class(self): with self.settings(LOGOUT_REDIRECT_URL='/'): button = helpers.browserid_logout(link_class='go button') self.assertHTMLEqual(button, """ <a href="/browserid/logout/" class="go button browserid-logout" data-next="/"> <span>Sign out</span> </a> """)
def test_logout_class(self): button = helpers.browserid_logout(link_class='go button') self.assertHTMLEqual( button, """ <a href="/browserid/logout/" class="go button browserid-logout" data-next=""> <span>Sign out</span> </a> """)
def test_logout_class(self): with self.settings(LOGOUT_REDIRECT_URL='/'): button = helpers.browserid_logout(link_class='go button') self.assertHTMLEqual( button, """ <a href="/browserid/logout/" class="go button" data-next="/"> <span>Sign out</span> </a> """)
def test_next_default(self): """next should default to LOGOUT_REDIRECT_URL""" with self.settings(LOGOUT_REDIRECT_URL='/foo/bar'): button = helpers.browserid_logout() self.assertHTMLEqual(button, """ <a href="/browserid/logout/" class="browserid-logout" data-next="/foo/bar"> <span>Sign out</span> </a> """)
def test_next_default(self): """next should default to LOGOUT_REDIRECT_URL""" with self.settings(LOGOUT_REDIRECT_URL='/foo/bar'): button = helpers.browserid_logout() self.assertHTMLEqual( button, """ <a href="/browserid/logout/" class="browserid-logout" data-next="/foo/bar"> <span>Sign out</span> </a> """)
def test_logout_class(self): # If browserid-logout isn't in the link_class argument, it should be # appended to it prior to calling browserid_button. with self.settings(LOGOUT_REDIRECT_URL='/'): button = helpers.browserid_logout(link_class='go button') self.assertHTMLEqual(button, """ <a href="/browserid/logout/" class="go button browserid-logout" data-next="/"> <span>Sign out</span> </a> """)
def test_logout_class(self): # If browserid-logout isn't in the link_class argument, it should be # appended to it prior to calling browserid_button. with self.settings(LOGOUT_REDIRECT_URL='/'): button = helpers.browserid_logout(link_class='go button') self.assertHTMLEqual( button, """ <a href="/browserid/logout/" class="go button browserid-logout" data-next="/"> <span>Sign out</span> </a> """)
def browserid_logout(**kwargs): return helpers.browserid_logout(**kwargs)
def browserid_logout(context, **kwargs): return helpers.browserid_logout(**kwargs)