Exemple #1
0
 def test_email_change(self):
     """
     email change
     """
     user = utils.create_user(password="******")
     form_data = {'email': '*****@*****.**', 'password': '******'}
     form = EmailChangeForm(data=form_data, user=user)
     self.assertEqual(form.is_valid(), True)
Exemple #2
0
 def test_email_change(self):
     """
     email change
     """
     user = utils.create_user(password="******")
     form_data = {'email': '*****@*****.**', 'password': '******'}
     form = EmailChangeForm(data=form_data, user=user)
     self.assertEqual(form.is_valid(), True)
Exemple #3
0
 def test_email_change_invalid(self):
     """
     email change invalid
     """
     user = utils.create_user(password="******", email="*****@*****.**")
     form_data = {'email': '*****@*****.**', 'password': '******'}
     form = EmailChangeForm(data=form_data, user=user)
     self.assertEqual(form.is_valid(), False)
     self.assertNotIn('email', form.cleaned_data)
     self.assertNotIn('password', form.cleaned_data)
Exemple #4
0
 def test_email_change_invalid(self):
     """
     email change invalid
     """
     user = utils.create_user(password="******", email="*****@*****.**")
     form_data = {'email': '*****@*****.**', 'password': '******'}
     form = EmailChangeForm(data=form_data, user=user)
     self.assertEqual(form.is_valid(), False)
     self.assertNotIn('email', form.cleaned_data)
     self.assertNotIn('password', form.cleaned_data)