Opened 13 years ago

Last modified 12 years ago

#146 closed enhancement

Make messaging system testable — at Version 15

Reported by: Christopher Allan Webber Owned by: Chris Moylan
Priority: minor Milestone:
Component: programming Keywords: bitesized
Cc: Parent Tickets:

Description (last modified by Christopher Allan Webber)

We should make it possible to test the messaging system.

If you look at mediagoblin/utils.py you can see what happens when
we \_activate\_testing() for some other things... ie, we insert
template context info like so:

::

        if TESTS_ENABLED:
            TEMPLATE_TEST_CONTEXT[template_path] = context

Maybe we should do something similar with messaging? Either we
should store in a dictionary like TEMPLATE\_TEST\_CONTEXT, maybe
TEST\_MESSAGES (which gets wiped by clear\_test\_buckets()) or we
should store in the session like request.session['test\_messages']
(should also get wiped by clear\_test\_buckets())

I'm assigning this to Caleb Davis who I think is a good fit for
it.



Change History (18)

comment:1 by Christopher Allan Webber, 13 years ago

Owner: changed from Caleb Davis to Chris Moylan
Assigning to cmoylan!



comment:2 by Caleb Davis, 13 years ago

go cmoylan, go! :)



comment:3 by Will Kahn-Greene, 13 years ago

Milestone: 0.0.40.0.5
We release 0.0.4, so I'm bumping this to 0.0.5.



comment:4 by Chris Moylan, 13 years ago

Seems like the best way to do this is to move the messaging
functions into util.py.



comment:5 by Christopher Allan Webber, 13 years ago

Indeed, though I think Aaron is facing some of this stuff in
`http://bugs.foocorp.net/issues/444 <http://bugs.foocorp.net/issues/444>`_,
so adding him to this bug.



comment:6 by Christopher Allan Webber, 13 years ago

Ping :)



comment:7 by Chris Moylan, 13 years ago

I thought about moving messaging into util.py, but you're right -
it's a junk drawer of functionality. So instead I imported util.py
into messages.py to get access to the globals TESTS\_ENABLED and
TEMPLATE\_TEST\_CONTEXT. However, messages.py is already being
imported in util.py, so I'm not sure if there will be any circular
reference problems. I think the best solution would be to move the
test globals into their own file which can be imported wherever.



comment:8 by Christopher Allan Webber, 13 years ago

Milestone: 0.0.50.1.0

comment:8 by Christopher Allan Webber, 13 years ago

Re: util.py, probably
`http://bugs.foocorp.net/issues/444 <http://bugs.foocorp.net/issues/444>`_
is related :)



comment:9 by Chris Moylan, 13 years ago

So should this wait until 444 is resolved? I don't want to move
messaging into util.py if that's just going to create a headache
when it comes time to refactor it.



comment:10 by Christopher Allan Webber, 13 years ago

Milestone: 0.1.00.2.0

comment:11 by Elrond, 13 years ago

Milestone: 0.2.00.2.1

comment:10 by Shawn Khan, 13 years ago

Hi Chris, `#444 </issues/444>`_ is now done, are you still
interested in this ticket?



comment:11 by Christopher Allan Webber, 13 years ago

Yes it should be possible to move forward with this now. Chris
Moylan, if you're still interested, feel free to ping me on IRC!



comment:12 by Will Kahn-Greene, 13 years ago

The original url for this bug was http://bugs.foocorp.net/issues/436 .
Relations:
#154: related

comment:13 by Christopher Allan Webber, 13 years ago

No response recently from Chris Moylan on this. I'll send him an email. But if someone wants to just pick this up in the meanwhile they're welcome to. Should be reasonably simple.

comment:14 by Elrond, 13 years ago

Milestone: 0.2.1
Type: defectenhancement

comment:15 by Christopher Allan Webber, 12 years ago

Description: modified (diff)
Keywords: bitesized added
Note: See TracTickets for help on using tickets.