def METHOD_NAME(self, editor, date, selected):
    from pyface.qt import QtCore, QtGui
    qdate = QtCore.QDate(date.year, date.month, date.day)
    textformat = editor.control.dateTextFormat(qdate)
    if selected:
        self.assertEqual(
            textformat.fontWeight(),
            QtGui.QFont.Weight.Bold,
            "{!r} is not selected.".format(date),
        )
        self.check_date_bgcolor(editor, date, (0, 128, 0))
    else:
        self.assertEqual(
            textformat.fontWeight(),
            QtGui.QFont.Weight.Normal,
            "{!r} is not unselected.".format(date),
        )
        self.assertEqual(
            textformat.background().style(),
            QtCore.Qt.BrushStyle.NoBrush,
            "Expected brush to have been reset.",
        )
        self.check_date_bgcolor(editor, date, (0, 0, 0))