Ejemplo n.º 1
0
 def test_invalid_email_parse_literal_wrong_ast_type(self):
     test_value = ast.IntValue(value="1234")
     with self.assertRaisesRegex(
             GraphQLError,
             scalar_error_only_types("strings", "email address",
                                     str(ast.Type))):
         EmailAddress.parse_literal(test_value)
Ejemplo n.º 2
0
 def test_invalid_email_parse_literal_not_email(self):
     test_value = ast.StringValue(value='This Will Fail')
     with self.assertRaisesRegex(
             GraphQLError,
             scalar_error_type("email address", test_value.value)):
         EmailAddress.parse_literal(test_value)
Ejemplo n.º 3
0
 def test_invalid_email_parse_value_wrong_type(self):
     test_value = 1234
     with self.assertRaisesRegex(GraphQLError,
                                 scalar_error_type("String", test_value)):
         EmailAddress.parse_value(test_value)
Ejemplo n.º 4
0
 def test_invalid_email_parse_value_not_email(self):
     test_value = 'This Will Fail'
     with self.assertRaisesRegex(
             GraphQLError, scalar_error_type("email address", test_value)):
         EmailAddress.parse_value(test_value)
Ejemplo n.º 5
0
 def test_valid_email_parse_literal(self):
     assert EmailAddress.parse_literal(
         ast.StringValue(value="*****@*****.**"))
Ejemplo n.º 6
0
 def test_valid_email_parse_value(self):
     test_email = "*****@*****.**"
     assert EmailAddress.parse_value(test_email)
Ejemplo n.º 7
0
 def test_valid_email_serialize(self):
     test_email = '*****@*****.**'
     assert EmailAddress.serialize(test_email)