コード例 #1
0
ファイル: test_utils.py プロジェクト: foobacca/connect
 def test_registered_email(self):
     """
     Test that an email registered to another user is returned as False.
     i.e. It is NOT available for another user to use.
     """
     with self.assertRaises(ValidationError):
         validate_email_availability('*****@*****.**')
コード例 #2
0
    def clean_email(self):
        email = self.cleaned_data['email']

        if email != self.user.email:
            validate_email_availability(email)

        return email
コード例 #3
0
ファイル: forms.py プロジェクト: badri/connect
    def clean_email(self):
        email = self.cleaned_data['email']

        if email != self.user.email:
            validate_email_availability(email)

        return email
コード例 #4
0
ファイル: test_utils.py プロジェクト: xxfyx/connect
 def test_registered_email(self):
     """
     Test that an email registered to another user is returned as False.
     i.e. It is NOT available for another user to use.
     """
     with self.assertRaises(ValidationError):
         validate_email_availability('*****@*****.**')
コード例 #5
0
ファイル: test_utils.py プロジェクト: foobacca/connect
 def test_unregistered_email(self):
     """
     Test that an email not registered to another user is returned as True.
     i.e. It is available for another user to use.
     """
     unregistered = validate_email_availability(
         '*****@*****.**')
     self.assertTrue(unregistered)
コード例 #6
0
ファイル: test_utils.py プロジェクト: xxfyx/connect
 def test_unregistered_email(self):
     """
     Test that an email not registered to another user is returned as True.
     i.e. It is available for another user to use.
     """
     unregistered = validate_email_availability(
         '*****@*****.**')
     self.assertTrue(unregistered)