

def assertChatHistoryResponse(self, expected_data):
    (actual_data, actual_last_sms) = self.new_view.get_response_data(self.chat_user.get_id)
    expected_last_sms = (expected_data[(- 1)] if expected_data else None)
    expected_data = sorted(expected_data, key=(lambda sms: sms.date))
    expected_data = [self.sms_to_json(sms) for sms in expected_data]
    self.assertEqual(actual_data, expected_data)
    self.assertEqual(actual_last_sms, expected_last_sms)

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/sms/tests/test_chat.py ChatHistoryTestCase.assertChatHistoryResponse/original