Exemplo n.º 1
0
def test_video(c):
    name = 'testing.mp4'
    ar = 1
    controls = 2
    mute = 2
    enable = 1

    slides_settings = Slides_c.get()
    slides_settings.status = False
    video_settings = Vid.get()
    video_settings.enabled = True
    video = Media(True, name=name)
    db.session.add(video)
    db.session.commit()
    video_id = video.id

    response = c.post('/video',
                      data={
                          'video': video_id,
                          'ar': ar,
                          'enable': enable,
                          'mute': mute,
                          'controls': controls
                      },
                      follow_redirects=True)

    assert response.status == '200 OK'
    assert Vid.get().enable == enable
    assert Vid.get().vname == name
    assert Vid.get().mute == mute
    assert Vid.get().ar == ar
    assert Vid.get().controls == controls
    assert Vid.get().vkey == video_id
    assert Media.get(video_id).used is True
Exemplo n.º 2
0
def test_delete_multimedia(c):
    media = Media(True, False, False, False, 'testing.mp3')
    db.session.add(media)
    db.session.commit()
    media_id = media.id

    response = c.get(f'/multi_del/{media_id}', follow_redirects=True)

    assert media_id != 0
    assert response.status == '200 OK'
    assert Media.get(media_id) is None