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)
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)