Ejemplo n.º 1
0
def test_tutorial_proposal_create_form_valid(
        tutorial_proposal_data, request, user):
    request.user = user
    form = TutorialProposalCreateForm(
        request=request, data=tutorial_proposal_data,
    )
    assert form.is_valid()
Ejemplo n.º 2
0
def test_tutorial_proposal_create_form_valid(
        tutorial_proposal_data, request, user):
    request.user = user
    form = TutorialProposalCreateForm(
        request=request, data=tutorial_proposal_data,
    )
    assert form.is_valid()
Ejemplo n.º 3
0
def test_tutorial_proposal_create_form_valid(request, user):
    request.user = user
    form = TutorialProposalCreateForm(request=request, data={
        'title': 'Beyond the Style Guides',
        'category': 'PRAC',
        'duration': 'HALFDAY',
        'language': 'CHI',
        'python_level': 'INTERMEDIATE',
        'recording_policy': True,
    })
    assert form.is_valid()
Ejemplo n.º 4
0
def test_tutorial_proposal_create_form_anonymous(
        tutorial_proposal_data, request, invalid_user):
    request.user = invalid_user
    form = TutorialProposalCreateForm(
        request=request, data=tutorial_proposal_data,
    )
    assert not form.is_valid()
    assert form.errors == {
        '__all__': [
            'Only authenticated user with complete speaker profile may '
            'create a tutorial proposal.',
        ],
    }
Ejemplo n.º 5
0
def test_tutorial_proposal_create_form_anonymous(
        tutorial_proposal_data, request, invalid_user):
    request.user = invalid_user
    form = TutorialProposalCreateForm(
        request=request, data=tutorial_proposal_data,
    )
    assert not form.is_valid()
    assert form.errors == {
        '__all__': [
            'Only authenticated user with complete speaker profile may '
            'create a tutorial proposal.',
        ],
    }
Ejemplo n.º 6
0
def test_tutorial_proposal_create_form_no_request():
    form = TutorialProposalCreateForm(data={
        'title': 'Beyond the Style Guides',
        'category': 'PRAC',
        'duration': 'HALFDAY',
        'language': 'CHI',
        'python_level': 'INTERMEDIATE',
        'recording_policy': True,
    })
    assert not form.is_valid()
    assert form.errors == {
        '__all__': ['Proposal creation requires a request object.'],
    }
Ejemplo n.º 7
0
def test_tutorial_proposal_create_form_no_profile(request, bare_user):
    request.user = bare_user
    form = TutorialProposalCreateForm(request=request, data={
        'title': 'Beyond the Style Guides',
        'category': 'PRAC',
        'duration': 'HALFDAY',
        'language': 'CHI',
        'python_level': 'INTERMEDIATE',
        'recording_policy': True,
    })
    assert not form.is_valid()
    assert form.errors == {
        '__all__': [
            'Only authenticated user with complete speaker profile may '
            'submit a proposal.',
        ],
    }
Ejemplo n.º 8
0
def test_tutorial_proposal_create_form_no_request(tutorial_proposal_data):
    form = TutorialProposalCreateForm(data=tutorial_proposal_data)
    assert not form.is_valid()
    assert form.errors == {
        '__all__': ['Tutorial proposal creation requires a request object.'],
    }
Ejemplo n.º 9
0
def test_tutorial_proposal_create_form_no_request(tutorial_proposal_data):
    form = TutorialProposalCreateForm(data=tutorial_proposal_data)
    assert not form.is_valid()
    assert form.errors == {
        '__all__': ['Tutorial proposal creation requires a request object.'],
    }