Exemple #1
0
def test_schedule_export_schedule_html_task(mocker, event, slot):
    mocker.patch('django.core.management.call_command')
    from django.core.management import call_command  # Import here to avoid overriding mocks

    export_schedule_html.apply_async(kwargs={'event_id': event.id})

    call_command.assert_called_with('export_schedule_html', event.slug, '--zip')
def test_schedule_export_schedule_html_task_nozip(mocker, orga_client, event):
    mocker.patch('django.core.management.call_command')

    from pretalx.agenda.tasks import export_schedule_html
    export_schedule_html.apply_async(kwargs={'event_id': event.id, 'make_zip': False})

    from django.core.management import call_command
    call_command.assert_called_with('export_schedule_html', event.slug)
def test_html_export_release(mocker, event):
    mocker.patch('django.core.management.call_command')

    event.settings.export_html_on_schedule_release = True
    event.wip_schedule.freeze(name="ohaio means hello")

    from django.core.management import call_command
    call_command.assert_called_with('export_schedule_html', event.slug, '--zip')
Exemple #4
0
def test_schedule_export_schedule_html_task_nozip(mocker, event, slot):
    mocker.patch("django.core.management.call_command")
    from django.core.management import (
        call_command,
    )  # Import here to avoid overriding mocks

    export_schedule_html.apply_async(kwargs={"event_id": event.id, "make_zip": False})
    call_command.assert_called_with("export_schedule_html", event.slug)
def test_schedule_export_schedule_html_task(mocker, event, slot):
    mocker.patch('django.core.management.call_command')

    from pretalx.agenda.tasks import export_schedule_html

    export_schedule_html.apply_async(kwargs={'event_id': event.id})

    from django.core.management import call_command

    call_command.assert_called_with('export_schedule_html', event.slug,
                                    '--zip')
def test_html_export_release_with_celery(mocker, event):
    mocker.patch('django.core.management.call_command')

    from django.core.management import call_command  # Import here to avoid overriding mocks

    event.cache.delete('rebuild_schedule_export')
    event.settings.export_html_on_schedule_release = True
    event.wip_schedule.freeze(name="ohaio means hello")
    assert not event.cache.get('rebuild_schedule_export')

    call_command.assert_called_with('export_schedule_html', event.slug,
                                    '--zip')
Exemple #7
0
def test_html_export_release_with_celery(mocker, event):
    mocker.patch("django.core.management.call_command")

    from django.core.management import (
        call_command, )  # Import here to avoid overriding mocks

    with scope(event=event):
        event.cache.delete("rebuild_schedule_export")
        event.settings.export_html_on_schedule_release = True
        event.wip_schedule.freeze(name="ohaio means hello")
        assert not event.cache.get("rebuild_schedule_export")

    call_command.assert_called_with("export_schedule_html", event.slug,
                                    "--zip")