コード例 #1
0
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']
コード例 #2
0
def test_find_one_matching_is_none(sut: SqlalchemyRepository, widgets):
    assert sut.find_one_matching(Attr('priority').is_none()) is widgets['baz']
コード例 #3
0
def test_find_one_matching_is_true(sut: SqlalchemyRepository, widgets):
    assert sut.find_one_matching(Attr('deleted').is_true()) is widgets['baz']
コード例 #4
0
def test_find_one_matching_equality(sut: SqlalchemyRepository, widgets):
    assert sut.find_one_matching(Attr('name') == 'foo') is widgets['foo']