'Test googleanalytics.pageviews_by_document().'

@patch.object(googleanalytics, '_build_request')
def test_pageviews_by_document(self, _build_request):

    execute = _build_request.return_value.get.return_value.execute
    execute.return_value = PAGEVIEWS_BY_DOCUMENT_RESPONSE
    documents = []
    for i in range(1, 6):
        documents.append(ApprovedRevisionFactory(document__slug=('doc-%s' % i)).document)
    pageviews = googleanalytics.pageviews_by_document(date(2013, 1, 16), date(2013, 1, 16))
    eq_(5, len(pageviews))
    eq_(1, pageviews[documents[0].pk])
    eq_(2, pageviews[documents[1].pk])
    eq_(10, pageviews[documents[2].pk])
    eq_(39, pageviews[documents[3].pk])
    eq_(46, pageviews[documents[4].pk])
