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

Commit

Permalink
allow me to access /admin/ecosystem
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Sep 6, 2012
1 parent 41badce commit b0b99e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 14 additions & 1 deletion mkt/zadmin/tests/test_views.py
Expand Up @@ -15,6 +15,20 @@
from mkt.zadmin.models import FeaturedApp, FeaturedAppRegion


class TestEcosystem(amo.tests.TestCase):
fixtures = ['base/users']

def setUp(self):
self.url = reverse('mkt.zadmin.ecosystem')

def test_staff_access(self):
user = UserProfile.objects.get(email='regular@mozilla.com')
self.grant_permission(user, 'AdminTools:View')
self.client.login(username='regular@mozilla.com', password='password')
res = self.client.get(self.url)
eq_(res.status_code, 200)


class TestFeaturedApps(amo.tests.TestCase):
fixtures = ['base/users']

Expand Down Expand Up @@ -123,7 +137,6 @@ def test_set_region(self):
'region', flat=True)),
[2, 3])


def test_set_startdate(self):
f = FeaturedApp.objects.create(app=self.a1, category=None)
FeaturedAppRegion.objects.create(featured_app=f, region=1)
Expand Down
3 changes: 1 addition & 2 deletions mkt/zadmin/views.py
Expand Up @@ -2,7 +2,6 @@

import jingo

from django.contrib import admin
from django.http import HttpResponse
from django.shortcuts import redirect
from django.db import transaction
Expand All @@ -25,7 +24,7 @@ def featured_apps_admin(request):
return jingo.render(request, 'zadmin/featuredapp.html')


@admin.site.admin_view
@admin_required
def ecosystem(request):
if request.method == 'POST':
refresh_mdn_cache()
Expand Down

0 comments on commit b0b99e6

Please sign in to comment.