remove some self-specific stuff from settings

implements most, if not all, of #15
This commit is contained in:
Brian S. Stephan 2021-11-01 23:27:00 -05:00
parent 4ea824e86f
commit 8a62167cea
4 changed files with 17 additions and 17 deletions

View File

@ -52,7 +52,7 @@ class Config(object):
# customizations
DEFAULT_PAGE_STYLE = 'light'
TITLE_SUFFIX = 'incorporeal.org'
CONTACT_EMAIL = 'bss@incorporeal.org'
TITLE_SUFFIX = 'example.com'
CONTACT_EMAIL = 'admin@example.com'
# specify FAVICON in your instance config.py to override the suou icon
# specify FAVICON in your instance config.py to override the provided icon

View File

@ -23,7 +23,7 @@ def test_page_that_doesnt_exist(client):
assert response.status_code == 404
assert b'<b><tt>/ohuesthaoeusth</tt></b> does not seem to exist' in response.data
# test the contact email config
assert b'bss@incorporeal.org' in response.data
assert b'admin@example.com' in response.data
def test_files_outside_pages_do_not_get_served(client):
@ -39,7 +39,7 @@ def test_internal_server_error_serves_error_page(client):
assert response.status_code == 500
assert b'INTERNAL SERVER ERROR' in response.data
# test the contact email config
assert b'bss@incorporeal.org' in response.data
assert b'admin@example.com' in response.data
def test_oserror_is_500(client, app):
@ -70,28 +70,28 @@ def test_page_with_title_metadata(client):
"""Test that a page with title metadata has its title written."""
response = client.get('/')
assert response.status_code == 200
assert b'<title>Index - incorporeal.org</title>' in response.data
assert b'<title>Index - example.com</title>' in response.data
def test_page_without_title_metadata(client):
"""Test that a page without title metadata gets the default title."""
response = client.get('/no-title')
assert response.status_code == 200
assert b'<title>/no-title - incorporeal.org</title>' in response.data
assert b'<title>/no-title - example.com</title>' in response.data
def test_page_in_subdir_without_title_metadata(client):
"""Test that the title-less page display is as expected."""
response = client.get('/subdir//page-no-title')
assert response.status_code == 200
assert b'<title>/subdir/page-no-title - incorporeal.org</title>' in response.data
assert b'<title>/subdir/page-no-title - example.com</title>' in response.data
def test_page_with_card_metadata(client):
"""Test that a page with opengraph metadata."""
response = client.get('/more-metadata')
assert response.status_code == 200
assert b'<meta property="og:title" content="title for the page - incorporeal.org">' in response.data
assert b'<meta property="og:title" content="title for the page - example.com">' in response.data
assert b'<meta property="og:description" content="description of this page made even longer">' in response.data
assert b'<meta property="og:image" content="http://buh.com/test.img">' in response.data
@ -100,7 +100,7 @@ def test_page_with_card_title_even_when_no_metadata(client):
"""Test that a page without metadata still has a card with the derived title."""
response = client.get('/no-title')
assert response.status_code == 200
assert b'<meta property="og:title" content="/no-title - incorporeal.org">' in response.data
assert b'<meta property="og:title" content="/no-title - example.com">' in response.data
assert b'<meta property="og:description"' not in response.data
assert b'<meta property="og:image"' not in response.data
@ -109,7 +109,7 @@ def test_page_with_forced_empty_title_just_shows_suffix(client):
"""Test that if a page specifies a blank Title meta tag explicitly, only the suffix is used in the title."""
response = client.get('/forced-no-title')
assert response.status_code == 200
assert b'<title>incorporeal.org</title>' in response.data
assert b'<title>example.com</title>' in response.data
def test_page_with_redirect_meta_url_redirects(client):

View File

@ -20,7 +20,7 @@ def test_markdown_meta_extension_always():
client = app.test_client()
response = client.get('/')
assert response.status_code == 200
assert b'<title>Index - incorporeal.org</title>' in response.data
assert b'<title>Index - example.com</title>' in response.data
def test_custom_markdown_extensions_work():

View File

@ -9,19 +9,19 @@ from incorporealcms.pages import (generate_parent_navs, instance_resource_path_t
def test_generate_page_navs_index(app):
"""Test that the index page has navs to the root (itself)."""
with app.app_context():
assert generate_parent_navs('pages/index.md') == [('incorporeal.org', '/')]
assert generate_parent_navs('pages/index.md') == [('example.com', '/')]
def test_generate_page_navs_subdir_index(app):
"""Test that dir pages have navs to the root and themselves."""
with app.app_context():
assert generate_parent_navs('pages/subdir/index.md') == [('incorporeal.org', '/'), ('subdir', '/subdir/')]
assert generate_parent_navs('pages/subdir/index.md') == [('example.com', '/'), ('subdir', '/subdir/')]
def test_generate_page_navs_subdir_real_page(app):
"""Test that real pages have navs to the root, their parent, and themselves."""
with app.app_context():
assert generate_parent_navs('pages/subdir/page.md') == [('incorporeal.org', '/'), ('subdir', '/subdir/'),
assert generate_parent_navs('pages/subdir/page.md') == [('example.com', '/'), ('subdir', '/subdir/'),
('Page', '/subdir/page')]
@ -29,7 +29,7 @@ def test_generate_page_navs_subdir_with_title_parsing_real_page(app):
"""Test that title metadata is used in the nav text."""
with app.app_context():
assert generate_parent_navs('pages/subdir-with-title/page.md') == [
('incorporeal.org', '/'),
('example.com', '/'),
('SUB!', '/subdir-with-title/'),
('page', '/subdir-with-title/page')
]
@ -39,7 +39,7 @@ def test_generate_page_navs_subdir_with_no_index(app):
"""Test that breadcrumbs still generate even if a subdir doesn't have an index.md."""
with app.app_context():
assert generate_parent_navs('pages/no-index-dir/page.md') == [
('incorporeal.org', '/'),
('example.com', '/'),
('/no-index-dir/', '/no-index-dir/'),
('page', '/no-index-dir/page')
]