← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:fix-disconnectionerror-view-test-localhost-ipv6 into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:fix-disconnectionerror-view-test-localhost-ipv6 into launchpad:master.

Commit message:
Fix disconnection error view test to support IPv6 localhost

In some environments, localhost can get represented as '::1'
instead of 127.0.0.1 and that caused the current test implementation
to fail.


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/480185
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:fix-disconnectionerror-view-test-localhost-ipv6 into launchpad:master.
diff --git a/lib/lp/services/webapp/tests/test_error.py b/lib/lp/services/webapp/tests/test_error.py
index c223924..643f0f3 100644
--- a/lib/lp/services/webapp/tests/test_error.py
+++ b/lib/lp/services/webapp/tests/test_error.py
@@ -175,8 +175,7 @@ class TestDatabaseErrorViews(TestCase):
         # clauses for Postgres 14 support. Once we upgrade to Postgres,
         # all the code and assertions for older versions can be removed.
         libpq_14_connection_error_prefix_regex = (
-            r'connection to server at "localhost" \(127\.0\.0\.1\), '
-            r"port .* failed"
+            r'connection to server at "localhost" \(.*\), port .* failed'
         )
         self.assertThat(
             [