-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e051f1e
commit 8b4cf56
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
import django_mongodb | ||
|
||
URI = "mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/myDatabase?retryWrites=true&w=majority" | ||
URI = "mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/myDatabase?retryWrites=true&w=majority&tls=false" | ||
|
||
|
||
class MongoParseURITests(SimpleTestCase): | ||
|
@@ -20,14 +20,17 @@ def setUp(self): | |
self.addCleanup(self.patcher.stop) | ||
|
||
@patch("dns.resolver.resolve") | ||
def test_parse(self, mock_resolver): | ||
def test_srv_uri_with_options(self, mock_resolver): | ||
settings_dict = django_mongodb.parse(URI) | ||
self.assertEqual(settings_dict["ENGINE"], "django_mongodb") | ||
self.assertEqual(settings_dict["NAME"], "myDatabase") | ||
self.assertEqual(settings_dict["HOST"], "mongodb+srv://cluster0.example.mongodb.net") | ||
self.assertEqual(settings_dict["USER"], "myDatabaseUser") | ||
self.assertEqual(settings_dict["PASSWORD"], "D1fficultP@ssw0rd") | ||
self.assertEqual(settings_dict["PORT"], None) | ||
self.assertEqual( | ||
settings_dict["OPTIONS"], {"retryWrites": True, "w": "majority", "tls": False} | ||
) | ||
|
||
@patch("dns.resolver.resolve") | ||
def test_engine_kwarg(self, mock_resolver): | ||
|