Exemplo n.º 1
0
 def test_clean_username_invalid(self):
     UserFactory.create(username='******')
     user = UserFactory.create(username='******')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'username': '******'}
     with self.assertRaises(ValidationError):
         form.clean_username()
Exemplo n.º 2
0
 def test_clean_email_invalid(self):
     UserFactory.create(email='*****@*****.**')
     user = UserFactory.create(email='*****@*****.**')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'email': '*****@*****.**'}
     with self.assertRaises(ValidationError):
         form.clean_email()
Exemplo n.º 3
0
 def test_clean_username_invalid(self):
     UserFactory.create(username='******')
     user = UserFactory.create(username='******')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'username': '******'}
     with self.assertRaises(ValidationError):
         form.clean_username()
Exemplo n.º 4
0
 def test_clean_email_invalid(self):
     UserFactory.create(email='*****@*****.**')
     user = UserFactory.create(email='*****@*****.**')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'email': '*****@*****.**'}
     with self.assertRaises(ValidationError):
         form.clean_email()
Exemplo n.º 5
0
 def test_clean_username_invalid(self):
     UserFactory.create(username="******")
     user = UserFactory.create(username="******")
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {"username": "******"}
     with self.assertRaises(ValidationError):
         form.clean_username()
Exemplo n.º 6
0
 def test_clean_email_new_valid(self):
     user = UserFactory.create(email='*****@*****.**')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'email': '*****@*****.**'}
     eq_(form.clean_email(), '*****@*****.**')
Exemplo n.º 7
0
 def test_clean_username_new_valid(self):
     user = UserFactory.create(username='******')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'username': '******'}
     eq_(form.clean_username(), 'bar')
Exemplo n.º 8
0
 def test_clean_email_new_valid(self):
     user = UserFactory.create(email='*****@*****.**')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'email': '*****@*****.**'}
     eq_(form.clean_email(), '*****@*****.**')
Exemplo n.º 9
0
 def test_clean_username_new_valid(self):
     user = UserFactory.create(username='******')
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {'username': '******'}
     eq_(form.clean_username(), 'bar')
Exemplo n.º 10
0
 def test_clean_email_new_valid(self):
     user = UserFactory.create(email="*****@*****.**")
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {"email": "*****@*****.**"}
     eq_(form.clean_email(), "*****@*****.**")
Exemplo n.º 11
0
 def test_clean_username_new_valid(self):
     user = UserFactory.create(username="******")
     form = UserProfileAdminForm(None, instance=user.userprofile)
     form.cleaned_data = {"username": "******"}
     eq_(form.clean_username(), "bar")