End individual post url in /
This commit is contained in:
parent
13bdcaef9e
commit
89622db6c9
2 changed files with 4 additions and 3 deletions
|
|
@ -86,9 +86,10 @@ def get_post(id, check_author=True):
|
|||
|
||||
return post
|
||||
|
||||
@bp.route('/<int:id>')
|
||||
@bp.route('/<int:id>/')
|
||||
def individual_post(id):
|
||||
post = get_post(id, False)
|
||||
post = dict(get_post(id, False))
|
||||
post['body'] = markdown.markdown(post['body'])
|
||||
return render_template('blog/post.html', post=post)
|
||||
|
||||
@bp.route('/<int:id>/update', methods=('GET', 'POST'))
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ def test_firehose(client, auth):
|
|||
assert b'href="/1/update"' in response.data
|
||||
|
||||
def test_individual_page(client, auth):
|
||||
response = client.get('/1')
|
||||
response = client.get('/1/')
|
||||
assert b'test title' in response.data
|
||||
assert b'by test on 2018-01-01' in response.data
|
||||
assert b'test\nbody' in response.data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue