Did I find the right examples for you? yes no

All Samples(7)  |  Call(5)  |  Derive(0)  |  Import(2)

src/p/o/popcorn_maker-HEAD/popcorn_gallery/popcorn/views/projects.py   popcorn_maker(Download)
from ..models import (Project, ProjectCategory, Template, TemplateCategory,
                      ProjectCategoryMembership)
from ..utils import update_views_count, get_order_fields, update_vote_score
from ...base.utils import notify_admins
 
def user_project_summary(request, project):
    update_views_count(project)
    user_vote = Vote.objects.get_for_user(project, request.user)
    votes = update_vote_score(project)
    context = {
    tag_list = template.tags.all()
    user_vote = Vote.objects.get_for_user(template, request.user)
    votes = update_vote_score(template)
    context = {
        'template': template,

src/p/o/popcorn_maker-HEAD/popcorn_gallery/popcorn/tests/utils_tests.py   popcorn_maker(Download)
from dateutil.relativedelta import relativedelta
from nose.tools import eq_, ok_
from ..utils import (update_views_count, get_order_fields, update_vote_score,
                     get_valid_file_regex, import_zipped_template)
 
    def test_no_update_vote(self, mocked_vote):
        self.item.modified = datetime.datetime.utcnow() - relativedelta(minutes=1)
        votes = update_vote_score(self.item)
        eq_(votes['num_votes'], 1)
        eq_(votes['score'], 1)
    def test_update_vote(self, mocked_vote):
        self.item.modified = datetime.datetime.utcnow() - relativedelta(minutes=11)
        votes = update_vote_score(self.item)
        eq_(votes['num_votes'], 1)
        eq_(votes['score'], 1)
    def test_vote_no_change(self, mocked_vote):
        self.item.modified = datetime.datetime.utcnow() - relativedelta(minutes=11)
        self.item.votes_count = 1
        votes = update_vote_score(self.item)
        eq_(votes['num_votes'], 1)