def test_meeting_superuser_sees_everything(app, user, url_name, element_id,
                                           status):
    meeting = MeetingFactory(settings=MEDIA_ENABLED)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(meeting)
        _login_user(client, user)
        _test(client, url_for(url_name, meeting_id=meeting.id),
              element_id, status)
def test_meeting_tab_menu(app, url_name, perms, element_id, status):
    role = RoleUserMeetingFactory(role__permissions=perms,
                                  meeting__settings=MEDIA_ENABLED)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(role.meeting)
        _login_user(client, role.user)
        _test(client, url_for(url_name, meeting_id=role.meeting_id),
              element_id, status)
Example #3
0
def test_meeting_superuser_sees_everything(app, user, url_name, element_id,
                                           status):
    meeting = MeetingFactory(settings=MEDIA_ENABLED)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(meeting)
        _login_user(client, user)
        _test(client, url_for(url_name, meeting_id=meeting.id), element_id,
              status)
Example #4
0
def test_meeting_tab_menu(app, url_name, perms, element_id, status):
    role = RoleUserMeetingFactory(role__permissions=perms,
                                  meeting__settings=MEDIA_ENABLED)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(role.meeting)
        add_participant_custom_fields(role.meeting, MediaParticipantDummyForm)
        _login_user(client, role.user)
        _test(client, url_for(url_name, meeting_id=role.meeting_id),
              element_id, status)
Example #5
0
def test_meeting_owner_tab_menu(app, url_name, element_id, status):
    owner = StaffFactory()
    meeting = MeetingFactory(settings=MEDIA_ENABLED, owner=owner)

    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(meeting)
        _login_user(client, owner.user)
        _test(client, url_for(url_name, meeting_id=meeting.id), element_id,
              status)
def test_meeting_owner_tab_menu(app, url_name, element_id, status):
    owner = StaffFactory()
    meeting = MeetingFactory(settings=MEDIA_ENABLED,
                             owner=owner)

    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(meeting)
        _login_user(client, owner.user)
        _test(client, url_for(url_name, meeting_id=meeting.id),
              element_id, status)
def test_permissions_meeting_owner(app, url_name, status, default_meeting,
                                   monkeypatch, pdf_renderer, brand_dir):
    monkeypatch.setattr('mrt.meetings.participant.PdfRenderer', pdf_renderer)
    staff = StaffFactory()
    participant = ParticipantFactory(category__meeting__owner=staff)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(participant.meeting)
        _login_user(client, staff.user)
        _test(client, url_for(url_name,
                              participant_id=participant.id,
                              meeting_id=participant.meeting.id), status)
def test_permissions_participant(app, monkeypatch, pdf_renderer,
                                 url_name, perms, status, default_meeting,
                                 brand_dir):
    monkeypatch.setattr('mrt.meetings.participant.PdfRenderer', pdf_renderer)
    role = RoleUserMeetingFactory(role__permissions=perms)
    participant = ParticipantFactory(category__meeting=role.meeting)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(role.meeting)
        _login_user(client, role.user)
        _test(client, url_for(url_name,
                              participant_id=participant.id,
                              meeting_id=role.meeting.id), status)
def test_permissions_media_participant(app, url_name, perms, status,
                                       default_meeting):
    role = RoleUserMeetingFactory(role__permissions=perms)
    media = MediaParticipantFactory(category__meeting=role.meeting,
                                    category__category_type=Category.MEDIA)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(role.meeting, MediaParticipantDummyForm)
        _login_user(client, role.user)
        _test(
            client,
            url_for(url_name,
                    participant_id=media.id,
                    meeting_id=role.meeting.id), status)
def test_permissions_participant(app, monkeypatch, pdf_renderer, url_name,
                                 perms, status, default_meeting, brand_dir):
    monkeypatch.setattr('mrt.meetings.participant.PdfRenderer', pdf_renderer)
    role = RoleUserMeetingFactory(role__permissions=perms)
    participant = ParticipantFactory(category__meeting=role.meeting)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(role.meeting)
        _login_user(client, role.user)
        _test(
            client,
            url_for(url_name,
                    participant_id=participant.id,
                    meeting_id=role.meeting.id), status)
def test_permissions_meeting_owner(app, url_name, status, default_meeting,
                                   monkeypatch, pdf_renderer, brand_dir):
    monkeypatch.setattr('mrt.meetings.participant.PdfRenderer', pdf_renderer)
    staff = StaffFactory()
    participant = ParticipantFactory(category__meeting__owner=staff)
    client = app.test_client()
    with app.test_request_context():
        add_participant_custom_fields(participant.meeting)
        _login_user(client, staff.user)
        _test(
            client,
            url_for(url_name,
                    participant_id=participant.id,
                    meeting_id=participant.meeting.id), status)