def test_find_one_matching_and_clause(sut: SqlalchemyRepository, widgets): assert sut.find_one_matching((Attr('name').contains('foo*')) & (Attr('priority') > 1)) is widgets['foobar']
def test_find_one_matching_is_none(sut: SqlalchemyRepository, widgets): assert sut.find_one_matching(Attr('priority').is_none()) is widgets['baz']
def test_find_one_matching_is_true(sut: SqlalchemyRepository, widgets): assert sut.find_one_matching(Attr('deleted').is_true()) is widgets['baz']
def test_find_one_matching_equality(sut: SqlalchemyRepository, widgets): assert sut.find_one_matching(Attr('name') == 'foo') is widgets['foo']