def test_model_association_invalid(): message = "association 'crap' does not exist for model 'User'" with pytest.raises(UnknownAssociationError, match=message): User.association("crap")
def test_join_find_association() -> None: join = Join(User, ["pets"]) assoc = join.find_association() assert assoc == User.association("pets")
def test_model_association(): assert User.association("pets") == User.__associations__["pets"]