def setUp(self): self.app = App() self.app = self.app.bind('Container', self.app) self.app.bind('Test', object) self.app.bind('MailSmtpDriver', object) self.app.bind('View', View(self.app).render) self.app.bind('ViewClass', View(self.app))
def setUp(self): self.app = App() self.app.bind('Container', self.app) self.app.bind('MailBaseDriver', MyTestDriver) viewClass = View(self.app) self.app.bind('ViewClass', viewClass) self.app.bind('View', viewClass.render)
def setUp(self): self.app = App() self.app.bind('Container', self.app) self.app.bind('Test', object) self.app.bind('MailMailgunDriver', MailgunTestDriver) viewClass = View(self.app) self.app.bind('ViewClass', viewClass) self.app.bind('View', viewClass.render)
def setUp(self): self.app = App() self.app = self.app.bind('Container', self.app) self.app.bind('Test', object) viewClass = View(self.app) self.app.bind('ViewClass', viewClass) self.app.bind('View', viewClass.render) self.app.bind('MailLogDriver', MailLogDriver) self.app.bind('MailTerminalDriver', MailTerminalDriver)
def show(self, view: View): """Show the welcome page. Arguments: view {masonite.view.View} -- The Masonite view class. request {masonite.request.Request} -- The Masonite request class. Returns: masonite.view.View -- The Masonite view class. """ return view.render('welcome')
def confirm_email(self, request: Request, view: View, auth: Auth): """Confirm User email and show the correct response. Arguments: request {masonite.request.request} -- The Masonite request class. request {masonite.view.view} -- The Masonite view class. request {masonite.auth.auth} -- The Masonite Auth class. Returns: [type] -- [description] """ sign = Sign() token = sign.unsign(request.param('id')) if token is not None: tokenParts = token.split("::") if len(tokenParts) > 1: user = auth.auth_model.find(tokenParts[0]) if user.verified_at is None: timestamp = datetime.datetime.fromtimestamp( float(tokenParts[1])) now = datetime.datetime.now() timestamp_plus_10 = timestamp + datetime.timedelta( minutes=10) if now < timestamp_plus_10: user.verified_at = datetime.datetime.now() user.save() return view.render('auth/confirm', { 'app': config('application'), 'Auth': auth }) return view.render('auth/error', { 'app': config('application'), 'Auth': auth })
def verify_show(self, view: View, auth: Auth): """Show the Verify Email page for unverified users. Arguments: request {masonite.request.request} -- The Masonite request class. request {masonite.view.view} -- The Masonite view class. request {masonite.auth.auth} -- The Masonite Auth class. Returns: [type] -- [description] """ return view.render('auth/verify', { 'app': config('application'), 'Auth': auth })
def setUp(self): super().setUp() self.container = App() self.app = self.container self.app.bind('Container', self.app) view = View(self.container) self.request = Request(generate_wsgi()).load_environ(generate_wsgi()) self.request.key(application.KEY) self.app.bind('Request', self.request) self.container.bind('View', view.render) self.container.bind('ViewClass', view) self.auth = Guard(self.app) self.auth.register_guard('web', WebGuard) self.auth.guard('web').register_driver('jwt', AuthJwtDriver) self.auth.set('web') self.app.swap(Auth, self.auth) self.request.load_app(self.app)
def setUp(self): self.app = App() self.view = View(self.app) self.request = Request(generate_wsgi()).load_app(self.app) self.provider = HelpersProvider() self.provider.load_app(self.app).boot(self.view, self.request)
def setUp(self): self.container = App() view = View(self.container) self.container.bind('View', view.render) self.container.bind('ViewClass', view)
def returns_a_view(self, view: View): return view.render('index')
def view(self, view: View): return view.render('test', {'test': 'test'})
def v(self, view: View): return view.render('test')