コード例 #1
0
def article(article_type):
    """
    'status'
    'article_id'
    'timestamp_creation'
    'timestamp_publish'
    'title'
    'article_type'
    'site'
    'lang'
    'excerpt'
    'article_category'
    'url'
    'image_url'
    'body'
    'body_markdown'
    """
    article = Article(
        1,
        "article_id",
        datetime.datetime.now(),
        datetime.datetime.strptime("2016-02-05T00:00:00", "%Y-%m-%dT%H:%M:%S"),
        "I Endorse Bernie Sanders for President",
        article_type,
        "site",
        "lang",
        "Thank you. It’s good to be back in New Hampshire...",
        "article_category",
        "https://berniesanders.com/i-endorse-bernie-sanders-for-president/",
        "https://berniesanders.com/wp-content/uploads/2016/02/NAACP-President-and-CEO-Benjamin-Jealous-404x250.png",
        "body",
        "#As prepared for delivery on February 5, 2016\nThank you. It’s good to be back in New Hampshire.",
    )
    return article
コード例 #2
0
 def article(self, app_init):
     with app.app_context():
         a = Article(title='test title', content='test content')
         ArticleService().create_article(a)
         yield a