def test_app_globals(): g.oid_session() g.oid_session() h.set_context('test', 'wiki', neighborhood='Projects') assert g.app_static('css/wiki.css') == '/nf/_static_/wiki/css/wiki.css', g.app_static('css/wiki.css') assert g.url('/foo', a='foo bar') == 'http://localhost:80/foo?a=foo+bar', g.url('/foo', a='foo bar') assert g.url('/foo') == 'http://localhost:80/foo', g.url('/foo')
def test_app_globals(): g.oid_session() g.oid_session() h.set_context('test', 'wiki', neighborhood='Projects') assert g.app_static( 'css/wiki.css') == '/nf/_static_/wiki/css/wiki.css', g.app_static( 'css/wiki.css') assert g.url('/foo', a='foo bar') == 'http://localhost:80/foo?a=foo+bar', g.url( '/foo', a='foo bar') assert g.url('/foo') == 'http://localhost:80/foo', g.url('/foo')
def send_verification_link(self): self.nonce = sha256(os.urandom(10)).hexdigest() log.info('Sending verification link to %s', self._id) text = ''' To verify the email address %s belongs to the user %s, please visit the following URL: %s ''' % (self._id, self.claimed_by_user().username, g.url('/auth/verify_addr', a=self.nonce)) log.info('Verification email:\n%s', text) allura.tasks.mail_tasks.sendmail.post( destinations=[self._id], fromaddr=self._id, reply_to='', subject='Email address verification', message_id=h.gen_message_id(), text=text)