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()
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()
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.', ], }
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.'], }
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.', ], }
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.'], }