Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2517 from mstriemer/show-all-additional-reviews-1…
Browse files Browse the repository at this point in the history
…063711

Skip the query cache for unreviewed query (bug 1063711)
  • Loading branch information
mstriemer committed Sep 8, 2014
2 parents 76c3ec6 + 00d13c9 commit ad73c65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mkt/reviewers/models.py
Expand Up @@ -402,7 +402,7 @@ def unreviewed(self, queue, and_approved=False):
}
if and_approved:
query['app__status__in'] = amo.WEBAPPS_APPROVED_STATUSES
return self.get_queryset().filter(**query)
return self.get_queryset().no_cache().filter(**query)

def latest_for_queue(self, queue):
try:
Expand Down
11 changes: 11 additions & 0 deletions mkt/reviewers/tests/test_models.py
Expand Up @@ -338,6 +338,17 @@ def test_unreviewed_and_approved_one_approved_only_approved(self):
list(AdditionalReview.objects.unreviewed(
queue='queue-one', and_approved=True)))

def test_becoming_approved_lists_the_app_when_showing_approved(self):
self.unreviewed.app.update(status=amo.STATUS_PUBLIC)
eq_([self.unreviewed],
list(AdditionalReview.objects.unreviewed(
queue='queue-one', and_approved=True)))
self.unreviewed_too.app.update(status=amo.STATUS_PUBLIC)
# Caching might return the old queryset, but we don't want it to.
eq_([self.unreviewed, self.unreviewed_too],
list(AdditionalReview.objects.unreviewed(
queue='queue-one', and_approved=True)))


class BaseTarakoFunctionsTestCase(amo.tests.TestCase):
fixtures = fixture('webapp_337141')
Expand Down

0 comments on commit ad73c65

Please sign in to comment.