コード例 #1
0
ファイル: test_admin.py プロジェクト: Acidburn0zzz/mozillians
 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_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()
コード例 #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
ファイル: test_admin.py プロジェクト: Acidburn0zzz/mozillians
 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()
コード例 #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()
コード例 #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(), '*****@*****.**')
コード例 #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')
コード例 #8
0
ファイル: test_admin.py プロジェクト: Acidburn0zzz/mozillians
 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(), '*****@*****.**')
コード例 #9
0
ファイル: test_admin.py プロジェクト: Acidburn0zzz/mozillians
 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')
コード例 #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(), "*****@*****.**")
コード例 #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")