-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bbdea0
commit 1ccd0c4
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from fastui import prebuilt_html | ||
|
||
|
||
def test_prebuilt_html(): | ||
html = prebuilt_html() | ||
assert html.startswith('<!doctype html>') | ||
assert 'https://cdn.jsdelivr.net/npm/@pydantic/fastui-prebuilt' in html | ||
assert '<title></title>' in html | ||
assert '<meta name="fastui:APIRootUrl"' not in html | ||
assert '<meta name="fastui:APIPathMode"' not in html | ||
assert '<meta name="fastui:APIPathStrip"' not in html | ||
|
||
|
||
def test_prebuilt_html_meta_tags(): | ||
html = prebuilt_html( | ||
title='Test Title', | ||
api_root_url='/admin/api', | ||
api_path_mode='query', | ||
api_path_strip='/admin', | ||
) | ||
assert '<title>Test Title</title>' in html | ||
assert '<meta name="fastui:APIRootUrl" content="/admin/api" />' in html | ||
assert '<meta name="fastui:APIPathMode" content="query" />' in html | ||
assert '<meta name="fastui:APIPathStrip" content="/admin" />' in html |