def insert(self, doc, synced=False):
        doc.id = self.get_next_id()
        doc.synced = synced
        try:
            self.db.docs.insert(doc)
        except Exception as e:
            raise DatabaseException(e)
        return doc
def test_cnli(fake_qtile, patched_cnli, fake_window):
    widget = patched_cnli.CapsNumLockIndicator()
    fakebar = FakeBar([widget], window=fake_window)
    widget._configure(fake_qtile, fakebar)
    text = widget.poll()

    assert text == "Caps off Num on"