-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ryancheley/v0.3.0
V0.3.0
- Loading branch information
Showing
4 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
pelican/plugins/pelican_to_sqlite/test_pelican_to_sqlite.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from pelican.contents import Article | ||
from pelican.urlwrappers import Author, Category | ||
from pelican.utils import SafeDatetime | ||
|
||
from .pelican_to_sqlite import create_record | ||
|
||
|
||
def test_create_record(): | ||
metadata = { | ||
"author": Author("ryan", settings=None), | ||
"category": Category("musings", settings=None), | ||
"date": SafeDatetime.fromisoformat("2016-10-03"), | ||
"slug": "vins-last-game", | ||
"summary": "<p>This is the summary</p>", | ||
"title": "Vin's Last Game", | ||
"url": "2016/10/03/vins-last-game/", | ||
} | ||
content = Article(content="<p>This is the content</p>", metadata=metadata) | ||
|
||
actual = create_record(content) | ||
expected = { | ||
"author": "ryan", | ||
"category": "musings", | ||
"content": "This is the content\n\n", | ||
"published_date": "2016-10-03", | ||
"slug": "vins-last-game", | ||
"summary": "This is the summary\n\n", | ||
"title": "Vin's Last Game", | ||
"url": "https://www.ryancheley.com/2016/10/03/vins-last-game/", | ||
} | ||
assert actual == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.