def METHOD_NAME(self, editor, date, expected):
    from pyface.qt import QtCore
    qdate = QtCore.QDate(date.year, date.month, date.day)
    textformat = editor.control.dateTextFormat(qdate)
    color = textformat.background().color()
    actual = (color.red(), color.green(), color.blue())
    self.assertEqual(
        actual,
        expected,
        "Expected color: {!r}. Got color: {!r}".format(expected, actual),
    )