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()
 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()
Exemple #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()
 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')
 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')
Exemple #6
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")