update error to cannot_contact_registry

This commit is contained in:
Erin 2023-11-30 11:23:37 -08:00
parent 91077e7da0
commit ba87db7c56
No known key found for this signature in database
GPG key ID: 1CAD275313C62460
2 changed files with 5 additions and 3 deletions

View file

@ -8,6 +8,7 @@ from django.test import RequestFactory
from ..views import available, check_domain_available
from .common import less_console_noise
from registrar.tests.common import MockEppLib
from registrar.utility.errors import GenericError, GenericErrorCodes
from unittest.mock import call
from epplibwrapper import (
@ -115,7 +116,8 @@ class AvailableViewTest(MockEppLib):
# domain set to raise error returns false for availability and error message
error_domain_response = available(request, domain="errordomain.gov")
self.assertFalse(json.loads(error_domain_response.content)["available"])
self.assertIn("Error finding domain availability", json.loads(error_domain_response.content)["message"])
self.assertEqual(GenericError._error_mapping[GenericErrorCodes.CANNOT_CONTACT_REGISTRY],
json.loads(error_domain_response.content)["message"])
class AvailableAPITest(MockEppLib):

View file

@ -5,6 +5,7 @@ from django.http import JsonResponse
from django.utils.safestring import mark_safe
from registrar.templatetags.url_helpers import public_site_url
from registrar.utility.errors import GenericError, GenericErrorCodes
import requests
@ -30,8 +31,7 @@ DOMAIN_API_MESSAGES = {
),
"invalid": "Enter a domain using only letters, numbers, or hyphens (though we don't recommend using hyphens).",
"success": "That domain is available!",
"error": "Error finding domain availability. Please wait a few minutes and try again.\
If you continue to receive this error after a few tries, contact help@get.gov",
"error": GenericError._error_mapping[GenericErrorCodes.CANNOT_CONTACT_REGISTRY],
}