allow overriding the "incorporeal.org" in <title>
I'm not going to be able to use this software on incorporeal.org for a bit, so plan B
This commit is contained in:
		
							parent
							
								
									ab009e4f59
								
							
						
					
					
						commit
						337001a939
					
				@ -31,3 +31,5 @@ class Config(object):
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    TITLE_SUFFIX = 'incorporeal.org'
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
<!doctype html>
 | 
					<!doctype html>
 | 
				
			||||||
<title>{{ title }}{% if title %} - {% endif %}incorporeal.org</title>
 | 
					<title>{{ title }}{% if title %} - {% endif %}{{ config.TITLE_SUFFIX }}</title>
 | 
				
			||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
 | 
					<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
 | 
				
			||||||
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}">
 | 
					<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}">
 | 
				
			||||||
<section class="content">
 | 
					<section class="content">
 | 
				
			||||||
 | 
				
			|||||||
@ -11,3 +11,13 @@ def test_config():
 | 
				
			|||||||
    instance_path = os.path.join(HERE, 'instance')
 | 
					    instance_path = os.path.join(HERE, 'instance')
 | 
				
			||||||
    assert not create_app(instance_path=instance_path).testing
 | 
					    assert not create_app(instance_path=instance_path).testing
 | 
				
			||||||
    assert create_app(instance_path=instance_path, test_config={"TESTING": True}).testing
 | 
					    assert create_app(instance_path=instance_path, test_config={"TESTING": True}).testing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_title_override():
 | 
				
			||||||
 | 
					    """Test that a configuration with a specific title overrides the default."""
 | 
				
			||||||
 | 
					    instance_path = os.path.join(HERE, 'instance')
 | 
				
			||||||
 | 
					    app = create_app(instance_path=instance_path, test_config={'TITLE_SUFFIX': 'suou.net'})
 | 
				
			||||||
 | 
					    client = app.test_client()
 | 
				
			||||||
 | 
					    response = client.get('/no-title')
 | 
				
			||||||
 | 
					    assert response.status_code == 200
 | 
				
			||||||
 | 
					    assert b'<title>suou.net</title>' in response.data
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user