Skip to content

Commit

Permalink
Pyflakes corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
melinath committed Feb 26, 2013
1 parent c1c8940 commit ed70399
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 26 deletions.
16 changes: 7 additions & 9 deletions mirocommunity_saas/admin/upload_views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from functools import wraps

from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.http import Http404
from localtv.admin import upload_views
from localtv.decorators import require_site_admin
from uploadtemplate.models import Theme
Expand All @@ -22,12 +20,12 @@ def wrapper(*args, **kwargs):


class UploadtemplateAdmin(ThemeIndexView):
def get_context_data(self, **kwargs):
context = super(UploadtemplateAdmin, self).get_context_data(**kwargs)
tier = SiteTierInfo.objects.get_current().tier
if not tier.custom_themes:
context['themes'] = Theme.objects.none()
return context
def get_context_data(self, **kwargs):
context = super(UploadtemplateAdmin, self).get_context_data(**kwargs)
tier = SiteTierInfo.objects.get_current().tier
if not tier.custom_themes:
context['themes'] = Theme.objects.none()
return context


index = require_custom_themes(require_site_admin(UploadtemplateAdmin.as_view()))
Expand Down
2 changes: 0 additions & 2 deletions mirocommunity_saas/management/commands/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
from optparse import make_option
import urllib

from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.management import call_command
from django.core.management.base import BaseCommand
from localtv.models import SiteSettings
from localtv.tasks import CELERY_USING
Expand Down
18 changes: 7 additions & 11 deletions mirocommunity_saas/tests/functional/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
from StringIO import StringIO
import zipfile

from django.core.urlresolvers import reverse
from django.http import Http404
from localtv.models import SiteSettings, Video
import mock
from uploadtemplate.models import Theme

from mirocommunity_saas.admin.approve_reject_views import (approve_video,
feature_video,
_video_limit_wrapper,
approve_all)
from mirocommunity_saas.admin.approve_reject_views import (_video_limit_wrapper,
approve_all)
from mirocommunity_saas.admin.livesearch_views import approve
from mirocommunity_saas.tests import BaseTestCase

Expand All @@ -34,7 +30,7 @@ def test_passthrough(self):
"""
video = self.create_video(status=Video.ACTIVE)
request = self.factory.get('/', {'video_id': video.pk})
response = self.view(request)
self.view(request)
self.assertTrue(self.mock.called)

def test_no_limit(self):
Expand All @@ -47,7 +43,7 @@ def test_no_limit(self):
self.create_tier_info(tier)
video = self.create_video(status=Video.UNAPPROVED)
request = self.factory.get('/', {'video_id': video.pk})
response = self.view(request)
self.view(request)
self.assertTrue(self.mock.called)

def test_below_limit(self):
Expand All @@ -60,7 +56,7 @@ def test_below_limit(self):
self.create_tier_info(tier)
video = self.create_video(status=Video.UNAPPROVED)
request = self.factory.get('/', {'video_id': video.pk})
response = self.view(request)
self.view(request)
self.assertTrue(self.mock.called)

def test_below_limit__exact(self):
Expand All @@ -73,7 +69,7 @@ def test_below_limit__exact(self):
self.create_tier_info(tier)
video = self.create_video(status=Video.UNAPPROVED)
request = self.factory.get('/', {'video_id': video.pk})
response = self.view(request)
self.view(request)
self.assertTrue(self.mock.called)

def test_at_limit(self):
Expand Down Expand Up @@ -282,7 +278,7 @@ def test_approve__above_limit(self):
user=self.user)
with mock.patch('mirocommunity_saas.admin.livesearch_views.'
'LiveSearchApproveVideoView.get') as get:
response = approve(request)
approve(request)
self.assertFalse(get.called)


Expand Down
2 changes: 1 addition & 1 deletion mirocommunity_saas/tests/unit/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_get_context_data__bad_slug(self):
raised.
"""
tier3 = self.create_tier(name='Tier3', slug='tier3', price=10)
self.create_tier(name='Tier3', slug='tier3', price=10)
view = DowngradeConfirmationView()
view.request = self.factory.get('/', data={'tier': 'tier3'})
self.assertRaises(Http404, view.get_context_data)
Expand Down
1 change: 0 additions & 1 deletion mirocommunity_saas/tests/unit/test_enforcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from django.core.exceptions import ValidationError
from django.forms.formsets import TOTAL_FORM_COUNT, INITIAL_FORM_COUNT
from django.forms.models import model_to_dict
from django.http import Http404
from django.test.utils import override_settings
from localtv.models import SiteSettings, Video
from uploadtemplate.models import Theme
Expand Down
4 changes: 2 additions & 2 deletions mirocommunity_saas/tests/unit/test_mail.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime

from django.core import mail, management
from localtv.models import SiteSettings, Video
from localtv.models import SiteSettings
import mock

from mirocommunity_saas.tests import BaseTestCase
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_free_trial_ending__no_free_trial(self):

self.assertEqual(len(mail.outbox), 0)
with mock.patch.object(tier_info, 'subscription', None):
send_free_trial_ending()
send_free_trial_ending()
self.assertEqual(len(mail.outbox), 0)

def test_free_trial_ending(self):
Expand Down

0 comments on commit ed70399

Please sign in to comment.