Skip to content

Commit 4d155ac

Browse files
committed
pymongo driver does not support conn_*
1 parent 56fe609 commit 4d155ac

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ MONGODB_URI = "mongodb+srv://myDatabaseUser:D1fficultP%[email protected]
131131
DATABASES["default"] = django_mongodb.parse_uri(MONGODB_URI)
132132
```
133133

134-
#### `django_mongodb.parse_uri(uri, conn_max_age=0, conn_health_checks=False, test=None)`
134+
#### `django_mongodb.parse_uri(uri, test=None)`
135135

136-
- Use `conn_max_age` and `conn_health_checks` to configure [persistent database
137-
connections](https://docs.djangoproject.com/en/stable/ref/databases/#persistent-database-connections).
138136
- Use `test` to provide a dictionary of [settings for test databases](
139137
https://docs.djangoproject.com/en/stable/ref/settings/#test).
140138

django_mongodb/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def check_django_compatability():
2626
)
2727

2828

29-
def parse_uri(uri, conn_max_age=0, conn_health_checks=False, test=None):
29+
def parse_uri(uri, test=None):
3030
"""
3131
Convert the given uri into a dictionary suitable for Django's DATABASES
3232
setting.
@@ -51,8 +51,6 @@ def parse_uri(uri, conn_max_age=0, conn_health_checks=False, test=None):
5151
"USER": uri.get("username"),
5252
"PASSWORD": uri.get("password"),
5353
"OPTIONS": uri.get("options"),
54-
"CONN_MAX_AGE": conn_max_age,
55-
"CONN_HEALTH_CHECKS": conn_health_checks,
5654
}
5755
if test:
5856
settings_dict["TEST"] = test

tests/utils_/test_parse_uri.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ def test_localhosts_with_ports(self):
6363
self.assertEqual(settings_dict["HOST"], "localhost:27017,localhost:27018,localhost:27019")
6464
self.assertEqual(settings_dict["PORT"], None)
6565

66-
def test_conn_max_age(self):
67-
settings_dict = parse_uri(URI, conn_max_age=600)
68-
self.assertEqual(settings_dict["CONN_MAX_AGE"], 600)
69-
70-
def test_conn_health_checks(self):
71-
settings_dict = parse_uri(URI, conn_health_checks=True)
72-
self.assertEqual(settings_dict["CONN_HEALTH_CHECKS"], True)
73-
7466
def test_test_kwarg(self):
7567
settings_dict = parse_uri(URI, test={"NAME": "test_db"})
7668
self.assertEqual(settings_dict["TEST"]["NAME"], "test_db")

0 commit comments

Comments
 (0)