Пример #1
0
def test_model_association_invalid():
    message = "association 'crap' does not exist for model 'User'"

    with pytest.raises(UnknownAssociationError, match=message):
        User.association("crap")
Пример #2
0
def test_join_find_association() -> None:
    join = Join(User, ["pets"])
    assoc = join.find_association()
    assert assoc == User.association("pets")
Пример #3
0
def test_model_association():
    assert User.association("pets") == User.__associations__["pets"]