Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Twitter test and docs #328

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

lockhart commented Jul 20, 2012

Hi Stephen. I've added a test for the Twitter app (and fixed a typo in "multisite" for that test name in the same file). I've also added a note regarding possible side-effects of delayed updates for feeds on lightly-visited sites. It may be good to add more notes on usage in, say, mezzanine/twitter/init.py and let me know if you would like to see that.

lockhart added some commits Jul 20, 2012

Add a test case for the twitter app. This sets up a twitter feed via
a template and then renders the template. Use "stephenmcd" as the
test case feed.
Fix a typo in the name of the "multisite" test.
Fix typo in Stephen McDonald's twitter feed name.
Add mention of possible side-effects for twitter updates
on lightly-visited sites.
Owner

stephenmcd commented Jul 20, 2012

Awesome, thanks a lot Thomas.

Owner

stephenmcd commented Jul 20, 2012

Sorry Thomas just going over this now.

The docs update is actually incorrect - the first time a new Twitter query is rendered in a template, the query is marked as interested by default, and therefore fetches the tweets the first time it's viewed.

Also the new tests seem to be broken (the code itself) - did you try running them?

Contributor

lockhart commented Jul 21, 2012

On 12-07-20 8:38 AM, Stephen McDonald wrote:

Sorry Thomas just going over this now.

The docs update is actually incorrect - the first time a new Twitter query is rendered in a template, the query is marked as interested by default, and therefore fetches the tweets the first time it's viewed.
The behavior I was trying to explain (and for which my description may
be incorrect) is that the tweets will not be updated (leave aside the
very first time) unless "interested" is set true.

Here is the sequence I was trying to describe for a lightly-visited site:

  1. poll_twitter updates (only) those query entries which are marked
    "interested".
  2. poll_twitter then sets "interested" to false.
  3. a page containing a twitter tag gets visited some time later.

afaict the TemplateManager get_for() method marks an existing query as
"interested", but until poll_twitter runs again some time in the future
the tweets will not be updated. So if there is a large time gap between
page views then the tweets may be noticeably stale.

Also the new tests seem to be broken (the code itself) - did you try running them?

Will look at this.

             - Tom

@stephenmcd stephenmcd closed this Dec 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment