Ejemplo 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()
Ejemplo n.º 2
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()
Ejemplo 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()
Ejemplo n.º 4
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')
Ejemplo n.º 5
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')
Ejemplo n.º 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")