21:00 PM
jhauser joined the channel
21:00 PM
Pumukel has quit
21:01 PM
atomekk joined the channel
21:13 PM
monokrome joined the channel
21:13 PM
monokrome
hi :)
21:14 PM
Does anyone know the right way to get IBeforeRender signals to occur when calling `render_to_response`?
21:14 PM
or the proper way to do so :) Trying to unit test template rendering
21:14 PM
raydeo
monokrome: they should just work... make sure you are passing request=request possibly
21:14 PM
NotreDev joined the channel
21:15 PM
monokrome
raydeo: Hmm... I'm passing `request=self.request`, but no luck
21:15 PM
raydeo
make sure they are subscribed
21:15 PM
if it's a unit test maybe you didn't scan them
21:15 PM
monokrome
Also, sorry about not looking into Accept header stuffs... Seemingly got distracted and lost the channel :'(
21:15 PM
raydeo
fortunately for you it's still in the same state it was ;-)
21:16 PM
monokrome
I imported the module manually, and they are subscribed via decorators. I think that should have registered them?
21:16 PM
Ha, well unfortunately it's still a bug :'( !
21:16 PM
monokrome adds to her todo list
21:16 PM
raydeo
you must config.scan the module
21:18 PM
monokrome
config.scan('pyramid.subscribers') in setUp didn't seem to work either
21:18 PM
At least I know I'm on the right track, though! Thank you :)
21:19 PM
raydeo
no
21:19 PM
you need to scan *your* subscribers
21:19 PM
monokrome
Sorry, I meant 'aviation.subscribers' - freudian slip :)
21:20 PM
aviation is my project :)
21:20 PM
raydeo
ok well if they are decorators that should help
21:20 PM
maybe you need to config.commit() if you aren't making a wsgi app
21:20 PM
monokrome
Yep. Looks like it gets called now, but the template gets rendered before it gets called? O_o
21:21 PM
raydeo
huh
21:21 PM
monokrome
I probably broke somethign :D
21:22 PM
NotreDev has quit
21:22 PM
sawdog joined the channel
21:22 PM
Pumukel joined the channel
21:24 PM
Pumukel has quit
21:25 PM
jhauser has quit
21:25 PM
Pumukel joined the channel
21:27 PM
Pumukel has quit
21:28 PM
Pumukel joined the channel
21:29 PM
Ergo has quit
21:30 PM
loechel joined the channel
21:32 PM
Pumukel_ joined the channel
21:33 PM
Pumukel has quit
21:34 PM
Pumukel joined the channel
21:35 PM
loechel has quit
21:37 PM
loechel joined the channel
21:37 PM
Pumukel_ has quit
21:39 PM
Pumukel has quit
21:39 PM
MrTango has quit
21:40 PM
raydeo: aaah... It looks like this specific thing is using config.action, but that maybe doesn't work in unit tests? O_o
21:41 PM
raydeo
it works fine in unit tests
21:41 PM
monokrome
I called into config.action manually and did a config.conmmit() afterward in the test
21:41 PM
loechel has quit
21:41 PM
raydeo
feel free to paste a chunk of your code... it's a little difficult to debug the abstract
21:41 PM
zepolen joined the channel
21:41 PM
monokrome
hehe sorry :)
21:42 PM
raydeo
actions work fine, but they have a few different modes of operation
21:45 PM
monokrome
21:45 PM
Hope that helps?
21:45 PM
Pumukel joined the channel
21:46 PM
raydeo
an order of infinity seems a little aggressive ;-)
21:46 PM
monokrome
haha yeah :)
21:46 PM
That's like my "I don't mind as long as it happens" :D
21:47 PM
raydeo
so pyramid.testing.setUp() creates the configurator in autocommit mode
21:47 PM
meaning every action executes immediately instead of waiting for a config.commit()
21:47 PM
it also means order is irrelevant
21:48 PM
so if you care about such things then pass autocommit=False to setUp()
21:48 PM
monokrome
I don't :)
21:48 PM
raydeo
so what's the issue here?
21:49 PM
I don't see the actual test code so I can only assume you're saying that a BeforeRender is executed somewhere in the ether before render_to_response
21:49 PM
monokrome
I guess this one doesn't use IBeforeRender any more, let me add more relevant code
21:49 PM
MrTango joined the channel
21:51 PM
raydeo: I added the shortcuts part, and both functions execute - but `serialize` isn't in the template filters
21:52 PM
raydeo
ok so this isn't a BeforeRender question anymore I take it
21:52 PM
monokrome
raydeo: Yeah, sorry - I just mentioned that. Sorry!
21:52 PM
raydeo
gotcha
21:53 PM
Is the without filter there? or they're both missing
21:53 PM
monokrome
but I guess it's weird that the test executes that get_jinja_action, if I print jinja2.filters then it is as expected, but jinja raises an error about the filter not existing
21:53 PM
Maybe I need to do something to bind the dummyrequest to self.config? I don't think they know about eachothyer.
21:55 PM
raydeo
it's not necessary generally... the dummyrequest will find the config between setUp and tearDown
21:55 PM
monokrome
hmm ok
21:55 PM
raydeo
21:55 PM
"as long as no template was loaded it's safe"
21:55 PM
feels like a clue to me
21:56 PM
monokrome
Same, but this is the first template in any of our unit testing
21:56 PM
raydeo
have you tried using pyramid_jinja2's support for filters?
21:56 PM
monokrome
I'll look into that. I thought that was what I was doing :)
21:57 PM
raydeo
for example config.add_setting({'jinja2.filters': 'serialize=json.dumps'})
21:57 PM
note that you need to set the setting prior to including pyramid_jinja2 because of the autocommit mode
21:58 PM
I'm surprised your code doesn't work though, it seems ok
21:58 PM
just good to try alternatives to narrow it down
21:59 PM
_habnabit joined the channel
21:59 PM
monokrome
raydeo: Aaaaaah! It worked!!! :D
21:59 PM
Thank you!
21:59 PM
raydeo
that surprises me considering pyramid_jinja2 is also just changing the filters dict
21:59 PM
22:00 PM
monokrome
I bet it's an ordering issue? Maybe scanning subscribers broke timing or something
22:01 PM
raydeo
there's no threads here, so timing is out, but possibly an ordering thing
22:02 PM
monokrome
Nope, I removed config.scan so that didn't do it
22:02 PM
I meant ordering :)
22:02 PM
Maybe config.action is causing it somehow?
22:02 PM
NotreDev joined the channel
22:03 PM
Nope... Same issue if I manually call it. This is weird
22:03 PM
raydeo
are you *sure* that the action is invoked?
22:03 PM
monokrome
yep
22:03 PM
I printed the filters dict from the last line in the inner function and got output
22:04 PM
raydeo
yeah ... hmm
22:06 PM
monokrome
Thanks for your help. I probably would have given up on that one :o
22:07 PM
really weird
22:07 PM
raydeo
sure, if you had a reprodoucible little thing I could run I'd probably figure out wtf is going on but without it I'll just find a broom and a rug
22:08 PM
monokrome
I can try to make one after I send this PR!!! :)
22:08 PM
Would be good to know what happened even if it's solved indirectly?
22:08 PM
raydeo
right
22:17 PM
sawdog joined the channel
22:34 PM
calberto joined the channel
22:35 PM
christophler has quit
22:39 PM
calberto has quit
22:46 PM
bochecha has quit
22:48 PM
mr_jolly has quit
22:50 PM
christophler joined the channel
23:04 PM
zepolen has quit
23:05 PM
zepolen joined the channel
23:05 PM
23:07 PM
zepolen has quit
23:08 PM
zepolen joined the channel
23:09 PM
dowwie has quit
23:15 PM
NotreDev has quit
23:21 PM
Thorn joined the channel
23:24 PM
MrTango has quit
23:44 PM
waveform has quit
23:47 PM
sawdog joined the channel
23:50 PM
Pumukel has quit
23:59 PM
Method has quit