Пример #1
0
 def test_password_change_correct(self):
     form_data = {
         'old_password': '******',
         'new_password': '******',
         'confirm_password': '******',
     }
     form = ProfilePasswordChangeForm(data=form_data, )
     self.assertEqual(form.is_valid(), True)
Пример #2
0
 def test_password_change_incorrect(self):
     form_data = {
         'old_password': '******',
         'new_password': '******',
         'confirm_password': '******',
     }
     form = ProfilePasswordChangeForm(data=form_data, )
     self.assertEqual(form.is_valid(), False)
Пример #3
0
 def test_password_change_correct(self):
     form_data = {
         'old_password': '******',
         'new_password': '******',
         'confirm_password': '******',
     }
     form = ProfilePasswordChangeForm(
         data=form_data,
     )
     self.assertEqual(form.is_valid(), True)
Пример #4
0
 def test_password_change_incorrect(self):
     form_data = {
         'old_password': '******',
         'new_password': '******',
         'confirm_password': '******',
     }
     form = ProfilePasswordChangeForm(
         data=form_data,
     )
     self.assertEqual(form.is_valid(), False)
def default_forms(request):
    return {
        'registration_form': RegistrationForm(),
        'edit_profile_form': EditProfileForm(),
        'password_change_form': ProfilePasswordChangeForm()
    }