Hi,

On Fri, Nov 08, 2013 at 08:06:09PM -0800, Kristian wrote:
> I'm using webtest to test a functionality that send an email. I want to 
> catch the email in my unittest and get a url in the mail to further test. 
> Only problem, is I can't find how to get the mailer while using a webtest.
> 
> In my unittest, here's what I do:
> 
> res1 = self.testapp.get(url='/newuser', status=200)
> form = res1.form
> form['email'] = '[email protected]'
> form['passwd'] = 'passwd'
> form['passwd-confirm'] = 'passwd'
> res2 = form.submit('submit', status=302)
> mailer = get_mailer(*THIS NEEDS A REQUEST*)
> 
> Is there a way to find the request from res2 ? Or I cannot use webtest with 
> pyramid_mailer ?

You can use res2.request. But this one is not the one used in pyramid
internals. It may work if pyramid_mailer use request.environ to store its
settings.

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to