'If the constance setting for the Google Analytics API credentials is not
configured, or is misconfigured, calls to analytics_upageviews will
raise an ImproperlyConfigured error.  Show that we still get the rest of
the stats, along with a message.'

def test_misconfigured_google_analytics_does_not_block(self, mock_analytics_upageviews):

    mock_analytics_upageviews.side_effect = ImproperlyConfigured('Oops!')
    rev = self.create_revisions(num=1, creator=self.testuser, document=self.document)[0]
    rev.created = (datetime.datetime.today() - datetime.timedelta(days=1))
    rev.save()
    rev.akismet_submissions.create(sender=self.admin, type='spam')
    self.client.login(username='admin', password='testpass')
    response = self.client.get(reverse('dashboards.spam', locale='en-US'))
    eq_(200, response.status_code)
    response2 = self.client.get(reverse('dashboards.spam', locale='en-US'))
    self.assertContains(response2, 'Oops!', status_code=200)
    page = pq(response2.content)
    spam_trends_table = page.find('.spam-trends-table')
    eq_(len(spam_trends_table), 1)
    spam_events_table = page.find('.spam-events-table')
    eq_(len(spam_events_table), 1)
