Skip to content

Commit 05df78c

Browse files
committed
test for nodelist > 1
1 parent 33b5481 commit 05df78c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/utils_/test_parse_uri.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ def test_localhost(self):
4949
self.assertEqual(settings_dict["NAME"], "myDatabase")
5050
self.assertEqual(settings_dict["HOST"], "localhost")
5151

52+
def test_localhosts_with_ports(self):
53+
settings_dict = parse_uri(
54+
"mongodb://localhost:27017,localhost:27018,localhost:27019/myDatabase"
55+
)
56+
self.assertEqual(settings_dict["ENGINE"], "django_mongodb")
57+
self.assertEqual(settings_dict["NAME"], "myDatabase")
58+
self.assertEqual(settings_dict["HOST"], "localhost:27017,localhost:27018,localhost:27019")
59+
5260
@patch("dns.resolver.resolve")
5361
def test_conn_max_age(self, mock_resolver):
5462
settings_dict = parse_uri(URI, conn_max_age=600)

0 commit comments

Comments
 (0)