Compare commits

..

No commits in common. "44a49e5aeefff4ad29134ecf0b34e24b6e04cb67" and "f2fb55ea3330c8ab2dbc51f20c0baa94fd4e57c3" have entirely different histories.

3 changed files with 5 additions and 7 deletions

View file

@ -86,10 +86,9 @@ def get_post(id, check_author=True):
return post return post
@bp.route('/<int:id>/') @bp.route('/<int:id>')
def individual_post(id): def individual_post(id):
post = dict(get_post(id, False)) post = get_post(id, False)
post['body'] = markdown.markdown(post['body'])
return render_template('blog/post.html', post=post) return render_template('blog/post.html', post=post)
@bp.route('/<int:id>/update', methods=('GET', 'POST')) @bp.route('/<int:id>/update', methods=('GET', 'POST'))

View file

@ -12,7 +12,7 @@
<article class="post"> <article class="post">
<header> <header>
<div> <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 class="about">by {{ post['username'] }} on {{ post['created'].strftime('%Y-%m-%d') }}</div>
</div> </div>
{% if g.user['id'] == post['author_id'] %} {% if g.user['id'] == post['author_id'] %}

View file

@ -13,7 +13,6 @@ def test_index(client, auth):
assert b'by test on 2018-01-01' in response.data assert b'by test on 2018-01-01' in response.data
assert b'test\nbody' not in response.data assert b'test\nbody' not in response.data
assert b'href="/1/update"' in response.data assert b'href="/1/update"' in response.data
assert b'href="/1/"' in response.data
def test_firehose(client, auth): def test_firehose(client, auth):
response = client.get('/') response = client.get('/')
@ -21,7 +20,7 @@ def test_firehose(client, auth):
assert b"Register" not in response.data assert b"Register" not in response.data
auth.login() auth.login()
response = client.get('/firehose') response = client.get('/')
assert b'Log Out' in response.data assert b'Log Out' in response.data
assert b'test title' in response.data assert b'test title' in response.data
assert b'by test on 2018-01-01' 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 assert b'href="/1/update"' in response.data
def test_individual_page(client, auth): def test_individual_page(client, auth):
response = client.get('/1/') response = client.get('/1')
assert b'test title' in response.data assert b'test title' in response.data
assert b'by test on 2018-01-01' in response.data assert b'by test on 2018-01-01' in response.data
assert b'test\nbody' in response.data assert b'test\nbody' in response.data