Compare commits
No commits in common. "44a49e5aeefff4ad29134ecf0b34e24b6e04cb67" and "f2fb55ea3330c8ab2dbc51f20c0baa94fd4e57c3" have entirely different histories.
44a49e5aee
...
f2fb55ea33
3 changed files with 5 additions and 7 deletions
|
|
@ -86,10 +86,9 @@ def get_post(id, check_author=True):
|
|||
|
||||
return post
|
||||
|
||||
@bp.route('/<int:id>/')
|
||||
@bp.route('/<int:id>')
|
||||
def individual_post(id):
|
||||
post = dict(get_post(id, False))
|
||||
post['body'] = markdown.markdown(post['body'])
|
||||
post = get_post(id, False)
|
||||
return render_template('blog/post.html', post=post)
|
||||
|
||||
@bp.route('/<int:id>/update', methods=('GET', 'POST'))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<article class="post">
|
||||
<header>
|
||||
<div>
|
||||
<h1><a class="action" href="{{ url_for('blog.individual_post', id=post['id']) }}">{{ post['title'] }}</a></h1>
|
||||
<h1>{{ post['title'] }}</h1>
|
||||
<div class="about">by {{ post['username'] }} on {{ post['created'].strftime('%Y-%m-%d') }}</div>
|
||||
</div>
|
||||
{% if g.user['id'] == post['author_id'] %}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ def test_index(client, auth):
|
|||
assert b'by test on 2018-01-01' in response.data
|
||||
assert b'test\nbody' not in response.data
|
||||
assert b'href="/1/update"' in response.data
|
||||
assert b'href="/1/"' in response.data
|
||||
|
||||
def test_firehose(client, auth):
|
||||
response = client.get('/')
|
||||
|
|
@ -21,7 +20,7 @@ def test_firehose(client, auth):
|
|||
assert b"Register" not in response.data
|
||||
|
||||
auth.login()
|
||||
response = client.get('/firehose')
|
||||
response = client.get('/')
|
||||
assert b'Log Out' in response.data
|
||||
assert b'test title' in response.data
|
||||
assert b'by test on 2018-01-01' in response.data
|
||||
|
|
@ -29,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