def test_site(cards_table):
    """
    Expect a video card to require a site.
    """

    card, errors = VideoCard.insert({"unit_id": "RUF531", "name": "What is?", "video_id": "Ajklfjl4"})
    assert len(errors) == 1
    card["site"] = "youtube"
    errors = card.validate()
    assert len(errors) == 0
def test_video_id(cards_table):
    """
    Expect a video card to require a video_id.
    """

    card, errors = VideoCard.insert({"unit_id": "RUF531", "name": "What is?", "site": "youtube"})
    assert len(errors) == 1
    card["video_id"] = "JFKl94jl"
    errors = card.validate()
    assert len(errors) == 0
Esempio n. 3
0
def test_site(db_conn, cards_table):
    """
    Expect a video card to require a site.
    """

    card, errors = VideoCard.insert(db_conn, {
        'unit_id': 'RUF531',
        'name': 'What is?',
        'video_id': 'Ajklfjl4',
    })
    assert len(errors) == 1
    card['site'] = 'youtube'
    errors = card.validate(db_conn)
    assert len(errors) == 0
Esempio n. 4
0
def test_video_id(db_conn, cards_table):
    """
    Expect a video card to require a video_id.
    """

    card, errors = VideoCard.insert(db_conn, {
        'unit_id': 'RUF531',
        'name': 'What is?',
        'site': 'youtube'
    })
    assert len(errors) == 1
    card['video_id'] = 'JFKl94jl'
    errors = card.validate(db_conn)
    assert len(errors) == 0