25 lines
719 B
Python
25 lines
719 B
Python
"""Test journal views and helper methods."""
|
|
from incorporealcms.journal import journal_file_resolver
|
|
|
|
|
|
def test_journal_file_resolver_dir_to_index():
|
|
assert journal_file_resolver('foo/') == 'journal/foo/index.md'
|
|
|
|
|
|
def test_journal_file_resolver_subdir_to_index():
|
|
assert journal_file_resolver('foo/bar/') == 'journal/foo/bar/index.md'
|
|
|
|
|
|
def test_journal_file_resolver_other_requests_fine():
|
|
assert journal_file_resolver('foo/baz') == 'journal/foo/baz.md'
|
|
|
|
|
|
def test_journal_file_that_exists(client):
|
|
response = client.get('/')
|
|
assert response.status_code == 200
|
|
|
|
|
|
def test_journal_file_that_doesnt_exist(client):
|
|
response = client.get('/ohuesthaoeusth')
|
|
assert response.status_code == 404
|