Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aclark4life committed Dec 2, 2024
1 parent b14ace4 commit 5ebf6a2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/utils_/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ def test_srv_uri_with_options(self, mock_resolver):
settings_dict["OPTIONS"], {"retryWrites": True, "w": "majority", "tls": False}
)

def test_localhost(self):
settings_dict = django_mongodb.parse("mongodb://localhost/myDatabase")
self.assertEqual(settings_dict["ENGINE"], "django_mongodb")
self.assertEqual(settings_dict["NAME"], "myDatabase")
self.assertEqual(settings_dict["HOST"], "localhost")

def test_localhost_bad_credentials(self):
with self.assertRaises(pymongo.errors.InvalidURI):
django_mongodb.parse("mongodb://:@localhost/myDatabase")

@patch("dns.resolver.resolve")
def test_engine_kwarg(self, mock_resolver):
settings_dict = django_mongodb.parse(URI, engine="some_other_engine")
Expand Down

0 comments on commit 5ebf6a2

Please sign in to comment.