示例#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()
示例#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()
示例#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()
示例#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')
示例#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')
示例#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")