'A user with correct permissions is able to see the dashboard.'

def test_permissions(self, mock_analytics_upageviews):

    self.client.login(username='testuser', password='testpass')
    response = self.client.get(reverse('dashboards.spam', locale='en-US'))
    eq_(403, response.status_code)
    perm_akismet = Permission.objects.get(codename='add_revisionakismetsubmission')
    self.testuser.user_permissions.add(perm_akismet)
    response = self.client.get(reverse('dashboards.spam', locale='en-US'))
    eq_(403, response.status_code)
    perm_spam = Permission.objects.get(codename='add_documentspamattempt')
    self.testuser.user_permissions.add(perm_spam)
    response = self.client.get(reverse('dashboards.spam', locale='en-US'))
    eq_(403, response.status_code)
    perm_ban = Permission.objects.get(codename='add_userban')
    self.testuser.user_permissions.add(perm_ban)
    response = self.client.get(reverse('dashboards.spam', locale='en-US'))
    eq_(200, response.status_code)
    ok_(('text/html' in response['Content-Type']))
    ok_(('dashboards/spam.html' in [template.name for template in response.templates]))
