Beispiel #1
0
    def test_no_password(self):
        data = {'email': '*****@*****.**', 'password1': None}

        form = PasswordResetForm(user=mock.Mock())
        form.cleaned_data = data

        self.assertEquals(form.clean_password1(), None)
Beispiel #2
0
    def test_clean_password_invalid(self):
        data = {'email': '*****@*****.**', 'password1': u'asd'}

        form = PasswordResetForm(user=mock.Mock())
        form.cleaned_data = data

        self.assertRaises(forms.ValidationError, form.clean_password1)
Beispiel #3
0
    def test_no_password(self):
        data = {
            'email': '*****@*****.**',
            'password1': None
        }

        form = PasswordResetForm(user=mock.Mock())
        form.cleaned_data = data

        self.assertEquals(form.clean_password1(), None)
Beispiel #4
0
    def test_clean_password_invalid(self):
        data = {
            'email': '*****@*****.**',
            'password1': u'asd'
        }

        form = PasswordResetForm(user=mock.Mock())
        form.cleaned_data = data

        self.assertRaises(forms.ValidationError, form.clean_password1)