def test_new_story(news):
    """It's possible to create an empty story"""
    empty_story = Story(story_type=news)
    empty_story.save()
    assert empty_story.id is not None
    html = empty_story.get_html()
    assert len(html) > 0
Beispiel #2
0
def test_new_story(news):
    """It's possible to create an empty story"""
    empty_story = Story(story_type=news)
    empty_story.save()
    assert empty_story.id is not None
    html = empty_story.get_html()
    assert len(html) > 0
def test_create_story_from_xtags(news):
    source = """
    @tit:Hello World!
    @ing:A test story for you
    @txt:This story will rock the world!
    """
    new_story = Story(
        story_type=news,
        bodytext_markup=source,
    )
    tag_count = BlockTag.objects.count()
    assert tag_count == 20
    new_story.clean()
    new_story.save()

    assert new_story.title == 'Hello World!'
    assert new_story.lede == 'A test story for you'
    assert 'bodytext' in new_story.get_html()
Beispiel #4
0
def test_create_story_from_xtags(news):
    source = """
    @tit:Hello World!
    @ing:A test story for you
    @txt:This story will rock the world!
    """
    new_story = Story(
        story_type=news,
        bodytext_markup=source,
    )
    tag_count = BlockTag.objects.count()
    assert tag_count == 20
    new_story.clean()
    new_story.save()

    assert new_story.title == 'Hello World!'
    assert new_story.lede == 'A test story for you'
    assert 'bodytext' in new_story.get_html()