コード例 #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')
コード例 #2
0
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)
コード例 #3
0
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')
コード例 #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)
コード例 #5
0
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')
コード例 #6
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

    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')
コード例 #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")