'Test whether the LoncapaProblem knows about the time of queue requests'

def test_recentmost_queuetime(self):

    answer_ids = sorted(self.problem.get_question_answers())
    cmap = CorrectMap()
    for answer_id in answer_ids:
        cmap.update(CorrectMap(answer_id=answer_id, queuestate=None))
    self.problem.correct_map.update(cmap)
    self.assertEquals(self.problem.get_recentmost_queuetime(), None)
    cmap = CorrectMap()
    for (i, answer_id) in enumerate(answer_ids):
        queuekey = (1000 + i)
        latest_timestamp = datetime.now(UTC)
        queuestate = CodeResponseTest.make_queuestate(queuekey, latest_timestamp)
        cmap.update(CorrectMap(answer_id=answer_id, queuestate=queuestate))
    self.problem.correct_map.update(cmap)
    latest_timestamp = datetime.strptime(datetime.strftime(latest_timestamp, dateformat), dateformat).replace(tzinfo=UTC)
    self.assertEquals(self.problem.get_recentmost_queuetime(), latest_timestamp)
