예제 #1
0
def test_edit_profile_form_phone_not_isdigit():
    form = EditProfileForm()
    form.cleaned_data = {'phone': FAKE.phone_number()[:10]}
    try:
        form.clean()
    except ValidationError:
        pass
    else:
        assert 2 == 1
예제 #2
0
def test_edit_profile_form_phone_to_short():
    form = EditProfileForm()
    form.cleaned_data = {'phone': '2'}
    try:
        form.clean()
    except ValidationError:
        pass
    else:
        assert 2 == 1
예제 #3
0
def test_edit_profile_form():
    form = EditProfileForm()
    form.cleaned_data = {
        'phone': ''.join(i for i in FAKE.phone_number() if i.isdigit())[:10]
    }
    form.clean()