mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-21 03:49:22 +02:00
update error to cannot_contact_registry
This commit is contained in:
parent
91077e7da0
commit
ba87db7c56
2 changed files with 5 additions and 3 deletions
|
@ -8,6 +8,7 @@ from django.test import RequestFactory
|
||||||
from ..views import available, check_domain_available
|
from ..views import available, check_domain_available
|
||||||
from .common import less_console_noise
|
from .common import less_console_noise
|
||||||
from registrar.tests.common import MockEppLib
|
from registrar.tests.common import MockEppLib
|
||||||
|
from registrar.utility.errors import GenericError, GenericErrorCodes
|
||||||
from unittest.mock import call
|
from unittest.mock import call
|
||||||
|
|
||||||
from epplibwrapper import (
|
from epplibwrapper import (
|
||||||
|
@ -115,7 +116,8 @@ class AvailableViewTest(MockEppLib):
|
||||||
# domain set to raise error returns false for availability and error message
|
# domain set to raise error returns false for availability and error message
|
||||||
error_domain_response = available(request, domain="errordomain.gov")
|
error_domain_response = available(request, domain="errordomain.gov")
|
||||||
self.assertFalse(json.loads(error_domain_response.content)["available"])
|
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):
|
class AvailableAPITest(MockEppLib):
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ from django.http import JsonResponse
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
from registrar.templatetags.url_helpers import public_site_url
|
from registrar.templatetags.url_helpers import public_site_url
|
||||||
|
from registrar.utility.errors import GenericError, GenericErrorCodes
|
||||||
|
|
||||||
import requests
|
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).",
|
"invalid": "Enter a domain using only letters, numbers, or hyphens (though we don't recommend using hyphens).",
|
||||||
"success": "That domain is available!",
|
"success": "That domain is available!",
|
||||||
"error": "Error finding domain availability. Please wait a few minutes and try again.\
|
"error": GenericError._error_mapping[GenericErrorCodes.CANNOT_CONTACT_REGISTRY],
|
||||||
If you continue to receive this error after a few tries, contact help@get.gov",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue