Skip to content

Commit 3c86eea

Browse files
committed
update test
1 parent 31ea01c commit 3c86eea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
from unittest.mock import Mock
21
from custom_admin.template_backends import CustomAdminDjangoTemplate
32

43

5-
def test_get_template_in_dev_mode(settings):
4+
def test_get_template_in_dev_mode(settings, requests_mock):
5+
mock_req = requests_mock.get(
6+
"http://127.0.0.1:8000/astro/test.html", text="Hello, Astro!"
7+
)
68
settings.DEBUG = True
79

810
backend = CustomAdminDjangoTemplate(
911
{"NAME": "", "DIRS": [], "APP_DIRS": False, "OPTIONS": {}}
1012
)
11-
backend.engine = Mock()
12-
backend.get_template("astro/test.html")
13-
backend.engine.get_template.assert_called_with("admin/iframe.html")
13+
result = backend.get_template("astro/test.html")
14+
assert result.render() == "Hello, Astro!"
15+
assert mock_req.called

0 commit comments

Comments
 (0)