1 from unittest.mock import patch
3 from sqlmodel import create_engine
5 from ....conftest import get_testing_print_function, needs_py39
13 "secret_name": "Dive Wilson",
23 "secret_name": "Tommy Sharp",
33 "secret_name": "Pedro Parqueador",
43 "secret_name": "Pedro Parqueador",
50 {"id": 3, "headquarters": "Wakaland Capital City", "name": "Wakaland"},
53 "Preventers new hero:",
57 "secret_name": "Natalia Roman-on",
63 "Preventers new hero:",
67 "secret_name": "Steve Weird",
73 "Preventers new hero:",
77 "secret_name": "Esteban Rogelios",
79 "name": "Captain North America",
86 def test_tutorial(clear_sqlmodel):
87 from docs_src.tutorial.relationship_attributes.create_and_update_relationships import (
88 tutorial001_py39 as mod,
91 mod.sqlite_url = "sqlite://"
92 mod.engine = create_engine(mod.sqlite_url)
95 new_print = get_testing_print_function(calls)
97 with patch("builtins.print", new=new_print):
99 assert calls == expected_calls