'Test the reports interface.'

def testReports(self):

    with test_lib.FakeTime(rdfvalue.RDFDatetime.FromHumanReadable('2012/12/14')):
        AddFakeAuditLog('Fake    audit    description    14    Dec.', 'C.123', 'User123', token=self.token)
    with test_lib.FakeTime(rdfvalue.RDFDatetime.FromHumanReadable('2012/12/22')):
        AddFakeAuditLog('Fake    audit    description    22    Dec.', 'C.456', 'User456', token=self.token)
    self.CreateAdminUser('test')
    self.Open('/#/stats/')
    self.Click('css=#MostActiveUsersReportPlugin_anchor    i.jstree-icon')
    self.WaitUntil(self.IsTextPresent, 'Server    |    User    Breakdown')
    self.WaitUntil(self.IsTextPresent, 'No    data    to    display.')
    self.Type('css=grr-form-datetime    input', '2012-12-21    12:34')
    self.Click("css=button:contains('Show    report')")
    self.WaitUntil(self.IsTextPresent, 'User456')
    self.WaitUntil(self.IsTextPresent, '100%')
    self.assertFalse(self.IsTextPresent('User123'))
